3.1. Estimation of Amount of Hydrogen Produced
The amount of hydrogen produced can be estimated based on the electrolysis current and Faraday efficiency, as expressed in Equation (1) [
26]. Electrolysis current
is calculated based on the cell current and active area, as shown in Equation (2). It is used with the voltage to compute the power consumption for hydrogen production, as shown in Equation (3). The electrolysis voltage (
) is determined by the cell voltage (
) and number of cells (
, as expressed in Equation (4).
is influenced by operating conditions such as the current and temperature [
27], and it directly affects the electrolysis power consumption (
). The method for estimating
, which accounts for these influencing factors, is described in
Section 3.2.
here,
represents the cell active area,
denotes the amount of hydrogen produced, and
denotes the Faraday efficiency.
3.2. Estimation of Cell Voltage
The PEMWE voltage can be divided into the open-circuit voltage, activation, diffusion, and ohmic overpotentials, and it is expressed by Equation (5) [
28].
The open-circuit voltage (
represents the minimum voltage required to initiate the electrolysis reaction, and it is defined by the Nernst equation given by Equation (6) [
28].
here,
represents the reversible cell potential, which can be approximated as 1.23 V under standard temperature and pressure conditions [
29].
is the gas constant,
is the temperature,
is the reference temperature,
is the Faraday constant,
and
are the partial pressures of hydrogen and oxygen, respectively, and
denotes the water activity.
represents the overpotential caused by changes in the concentration of reactants on the electrode surface, and it is calculated using the Nernst equation given by Equation (7) [
30].
here,
is current density,
and
are the oxygen and hydrogen concentration at the membrane electrode interface, respectively,
and
are the reference working conditions,
and
are the anode and cathode thicknesses, respectively,
and
denote the effective binary diffusivities, and
and
denote the operating pressures at the anode and cathode, respectively.
,
and
denote the molar flows of oxygen, hydrogen, and water, respectively.
The losses that occur during electrochemical activation are represented by
and are based on the Butler–Volmer equation.
is expressed as the sum of the activation overvoltages at the anode and cathode and the voltage degradation caused by on/off switching, as shown in Equation (8).
here,
and
are the charge transfer coefficients of the anode and cathode, respectively,
and
represent the exchange current densities of the anode and cathode, respectively.
The ohmic overvoltage varies depending on the electrical resistance caused by the transport of electrons and ions, and it is based on Ohm’s law.
is expressed as a function of the membrane electrode assembly (MEA) resistance and current density, as given by Equation (9).
here,
represents the membrane thickness and
denotes the initial conductivity.
3.3. Hydrogen Compressor Model
The compressor is modeled assuming that multiple pistons operate in phase to maintain a constant mass flow rate when the compressor is on, and its performance is affected by the inlet pressure [
31]. The hydrogen compressor is modeled with reasonable accuracy by assuming that hydrogen is an ideal gas, and the process is considered to be a polytropic compression [
32]. The maximum amount of hydrogen that each compressor can compress at time t is given by Equation (10), and this amount depends on the inlet pressure. The power consumption of the compressor is modeled based on the shaft power equation given by Equation (11).
represents the power consumption of the compressor, which is affected by the inlet and outlet pressures.
here,
represents the number of compressors,
is the volumetric gas flow rate of the compressor,
is the compressor speed,
is the displacement of the compressor,
is the volumetric efficiency,
and
are the outlet and inlet pressures, respectively,
represents the specific heat of hydrogen,
is the compressibility factor of hydrogen, and
is the heat capacity ratio, which is assumed to be constant.
3.4. HRS Operation
The objective of the proposed on-site HRS is to maximize the operating profit, and the objective function is given by Equation (12). The operating profit consists of the electricity sales revenue, which refers to the income generated by feeding surplus power back to the grid, and the hydrogen sales revenue, which refers to the income earned by supplying hydrogen to meet a specified demand. The operating costs include the electricity purchase cost, which is incurred to procure the power required in addition to the power supplied by renewable energy, and the ESS degradation cost (Equation (13)), which accounts for the wear and tear associated with charging and discharging operations.
Equation (14) expresses the power balance in the HRS. In addition, Equations (15) and (16) define the power-exchange constraints that prevent simultaneous electricity purchase and sale at the same time step.
here,
is the exported electricity,
is the unit price of the electricity sold to the grid,
is the amount of hydrogen sold, and
is the unit price of hydrogen.
is the electricity purchased from the grid, and
is its unit price.
represents the ESS degradation cost.
indicates the time step of the HRS operation, and
denotes the set of operating periods.
is the unit degradation cost of the ESS, and
and
represent the discharging and charging powers of the ESS, respectively.
is the electricity used for hydrogen production via electrolysis,
is the power consumption of the compressor, and
is the generated PV power.
To account for ESS degradation costs, the average wear cost (AWC) was estimated based on the depth of discharge (DoD)–achievable cycle count (ACC) relationship, as expressed in Equation (17) [
33]. This linear approximation—derived by linearizing the battery degradation model—was adopted to ensure computational efficiency, preserve the consistent linearity of the proposed optimization framework, and enhance practical implementability. The ESS degradation cost is calculated based on a fixed DoD and ACC corresponding to a specific end-of-life (EoL) criterion. DoD represents the depth to which the battery is discharged, and ACC refers to the number of charge/discharge cycles that can be repeated at that DoD. Battery aging depends on the DoD. To quantify this effect, this study applies a lifetime evaluation model that reflects the DoD–ACC relationship of lithium-ion batteries. The battery degradation cost (
) is calculated by dividing the battery price by the total usable energy, where
accounts for the losses occurring during the charging and discharging processes.
To prevent the simultaneous charging and discharging of the hydrogen storage tanks, adjacent compressors are not allowed to operate simultaneously. The compressor operation is modeled using binary variables, as given by Equations (18) and (19).
here,
is a binary variable that represents the operating status of the compressor and
denotes the maximum compression capacity of the compressor.
The hydrogen storage tanks were modeled using the ideal gas law. Within the considered pressure range, the effects of temperature and the real-gas compressibility factor
were assumed negligible and were therefore excluded from the model [
34]. The amount of hydrogen produced via electrolysis is assumed to be equal to the hydrogen that flows into the holder of tank 1. The low-pressure, medium-pressure, and high-pressure tanks receive the hydrogen that has been compressed from the lower-pressure stage, as expressed in Equation (20). The outflow from the hydrogen tanks is categorized as either the inflow to the next-stage compressor or the final outflow for hydrogen sales, as given by Equation (21). Equation (22) represents the hydrogen storage state of the tanks, and Equation (23) defines the initial and final constraints of the hydrogen storage tanks.
The hydrogen storage tanks are represented in terms of pressure, where
denotes the tank index.
and
represent the hydrogen inflow and outflow of a tank, respectively.
is the molar mass of hydrogen, and
is the volume of the tank [
35].
The operating and state-of-charge (SOC) constraints for the ESS operation are defined by Equations (24)–(29).
The initial and final SOCs of the ESS are set to be equal through Equation (24). The upper and lower bounds of the battery SOC are constrained within and respectively, as defined by Equation (25). The at time is determined by the amount of charging and discharging, as expressed in Equation (26). Equations (27) and (28) limit the charging and discharging powers of the ESS, whereas Equation (29) imposes a constraint to prevent simultaneous charging and discharging.
3.5. PEMWE Degradation Calculation
The degradation of the PEMWE considers the membrane damage and catalyst degradation that occur during operation. On/off switching significantly affects catalyst degradation, leading to an increase in
. An empirical model derived from the relationship between voltage and internal resistance is applied to quantitatively assess the effect on the catalyst. In this model, the level of degradation is calculated based on the number of on/off cycles and curve-fitting coefficient
. Equation (30) represents the degradation caused by on/off switching [
36].
MEA degradation is categorized into membrane thickness degradation and conductivity degradation. The reduction in the membrane thickness is affected by the hydroxyl radicals generated during hydrogen production, and the formation of these radicals is determined by the system temperature and current density. Membrane thickness degradation is estimated based on the amount of fluorine released. The conductivity of the MEA is determined by its thickness. Equations (31) and (32) represent the degradation in the membrane thickness and MEA conductivity, respectively [
37].
Here, represents the MEA thickness, is the fluorine content of the MEA, is the MEA density, denotes the fluorine discharge rate, and represents the MEA conductivity.