1. Introduction
Global energy demand is steadily increasing, driven by rising industrialization, urbanization, and population growth. Fossil fuels, which have long been the dominant source of energy, still account for a large share of global energy consumption. However, their widespread use contributes significantly to greenhouse gas emissions, leading to various environmental issues, such as worsening air pollution and the depletion of natural resources. The combustion of fossil fuels for energy production plays a major role in climate change, while the industrial processes that rely on these fuels release substantial carbon emissions. Approximately 87% of the world’s primary energy supply is derived from oil, coal, and natural gas [
1]. Over the past century, industries have depended on carbon-intensive fuels like oil and coal to meet their energy needs. As a result, carbon dioxide emissions from fossil fuel consumption in industrial activities make up the largest share of overall greenhouse gas emissions [
2]. The rising environmental concerns and increasing energy demand highlight the urgent need for a shift toward more sustainable and cleaner energy solutions. Renewable energy sources like solar, wind, and biomass are emerging as viable alternatives, providing cleaner options to fossil fuels by reducing greenhouse gas emissions and minimizing environmental impact. Among these alternatives, hydrogen stands out as an appealing energy source. Hydrogen promises a climate-friendly and environmentally clean form of transportation across land, air, space, and sea, offering a significant step forward in reducing our carbon footprint [
3]. A comparison of hydrogen production techniques such as anaerobic digestion, photo fermentation, dark fermentation, electrolysis, electrodialysis, photocatalysis, photoelectrochemical methods, and super water gasification indicates that dark fermentation is the most cost-effective method. It is followed by microbial electrolysis and photo fermentation in terms of economic efficiency [
4]. The electrolysis of wastewater containing aniline offers a promising approach for producing both polyaniline and hydrogen, while maintaining low energy consumption. This process provides an efficient way to generate valuable materials alongside clean energy, making it a potentially sustainable solution for wastewater treatment and hydrogen production [
5].
Zakaria et al. [
6] conducted a study in an MEC to treat primary sludge from wastewater treatment. The COD removal efficiency was found to be 73%, and the hydrogen production rate was 145 L/m
3. A case study on hydrogen production from municipal wastewater using microbial electrolysis cells (MEC) demonstrated its potential and outlined plans for pilot-scale implementation [
7]. Biohydrogen was produced from sugar industry wastewater using metal oxide/graphene catalysts in a microbial electrolysis cell (MEC). The system achieved a coulombic efficiency of 65.6% and a hydrogen recovery rate of 20.8% [
8].
Treating wastewater is essential to protect both the environment and public health from pollutants originating in domestic and industrial sources. The process generally includes preliminary, primary, and secondary stages designed to eliminate solids and reduce organic content. Technological advancements—such as membrane filtration and other advanced treatment methods have significantly improved the removal of nutrients and harmful substances, making treated water suitable for reuse. Additionally, desalination methods like reverse osmosis and electrodialysis are becoming increasingly important for producing drinking water. To meet regulatory water quality standards and safeguard ecosystems, sustained investment and efficient management of modern treatment systems are crucial [
9].
Various techniques for wastewater treatment have been documented in the literature, commonly classified into physical, chemical, and biological methods. These approaches are widely regarded as effective for addressing different aspects of water contamination and ensuring treatment efficiency. Wawrzkiewicz et al. [
10] conclude that their selection depends on various factors like dye concentration, sewage composition, cost of the process, or the additional impurities present in wastewater. Wastewater treatment methods that involve high installation and operating costs, long processing times, low efficiency, or the generation of toxic byproducts are generally less suitable for industrial use. These limitations reduce their practicality and cost-effectiveness on a larger scale [
11]. Biological treatment systems that rely on microorganisms have proven highly effective in breaking down waste, making them particularly valuable for treating household wastewater. In contrast, physical methods like sedimentation and degasification are crucial for removing contaminants without altering the chemical or biological composition of the water. Together, these approaches contribute significantly to improving overall treatment efficiency [
12]. Continuous innovation and the development of sustainable solutions are essential to address the environmental and health impacts of oily wastewater pollution [
13]. Advancements in solar-based technologies, such as photocatalysis and desalination, offer promising approaches for wastewater treatment by reducing greenhouse gas emissions and contributing to global water scarcity mitigation, though further economic feasibility is needed [
14].
A review of existing literature reveals that hydrogen production and wastewater treatment are largely studied as separate processes and rely on conventional energy sources. While solar energy provides a sustainable option, it is unexplored in the integration with wastewater treatment and hydrogen production, especially for the industrial sector in Pakistan. Moreover, the potential of industrial wastewater as both a feedstock for hydrogen generation and a target for purification remains underutilized. This highlights a critical research gap and the need for innovative, solar-powered solutions capable of simultaneously producing green hydrogen and treating wastewater in a combined, sustainable process.
2. System Design and Integration for Wastewater Treatment and Hydrogen Production
The proposed system combines wastewater treatment with renewable hydrogen production, powered entirely by solar energy. The process begins with wastewater being pumped into a desalination unit operating on the humidification–dehumidification (HDH) principle. As shown in
Figure 1, the wastewater is first pre-heated by incoming hot air in the dehumidifier, then further heated in a parabolic trough solar collector. This heated water is then sprayed into the humidifier, where it increases the humidity of the air. Brine is discharged from this step, while the now-humidified air is sent to the dehumidifier, where a temperature differential causes condensation. The resulting condensate, called permeate, is clean water.
This permeate is fed into an electrolyzer that splits water into hydrogen and oxygen through electrolysis. The system uses photovoltaic (PV) solar panels to provide the required electrical energy. Hydrogen is collected and stored for energy applications, while oxygen can be released or repurposed. All components—HDH, solar collector, PV, and electrolyzer—are integrated to operate autonomously using solar power, enabling sustainable wastewater treatment and hydrogen production.
3. Methodology
Figure 2 was modeled using two simulation platforms: TRNSYS 18 and Engineering Equation Solver (EES). The HDH subsystem was developed in EES and integrated into TRNSYS using the Type 66 interface for dynamic simulations. Key components including solar PV panels (Type 103b), power controller (Type 100a), power conditioner (Type 175a), electrolyzer (Type 160a), and compressed hydrogen tank (Type 164b) were selected from the TRNSYS library details are shown in
Table 1. Standard EPW weather data (Type 15-3) for Kohat was used to drive the simulations [
15].
The solar PV system was modeled using specifications from the Jinko Solar JKM555N-72HL4-BDV module, with a rated power of 555 W under standard test conditions. The electrolyzer was modeled after the Longi ALK H1 series [
16], while the solar thermal collector was based on the NEP SOLAR AG Poly Trough 1800 model, capable of handling 1800 L/h.
The simulation ran over a full calendar year with a 15-min time step to account for transient behavior and seasonal variation. Validation was performed by comparing component performance with manufacturer data. A simplifying assumption was made by maintaining a constant air humidity ratio of 100% in the HDH process to reduce model complexity. Primary outputs analyzed included solar power generation, hydrogen yield, and overall system efficiency. Monitoring tools such as online plotters (Type 65d) and data printers (Type 25c) were used to track outputs at key nodes in the system.
4. Results and Discussion
4.1. Clean Water Production
This study focused on a detailed investigation of hydrogen generation system by utilizing waste water and solar energy. Power obtained through solar PV, mass of clean water produced and the efficiency of electrolyzer are the key parameters which were analyzed during this study. This study was performed by considering the weather conditions of Kohat. Analysis was carried out throughout the year.
The variation in clean water production throughout the day across the whole year is shown in
Figure 3. The system demonstrates a clear production peak between 10:00 AM and 1:00 PM, followed by a steep decline in the afternoon. Notably, the highest production rates occur during cooler, low-humidity periods, reaching up to 300 kg/h for 4000 kg/day of wastewater supply. In contrast, hot and humid conditions result in significantly lower water output.
This behavior is tied to the operating principle of the humidification–dehumidification (HDH) system. HDH systems perform best in environments with low ambient humidity, where the vapor pressure gradient drives more effective mass transfer. Under high humidity conditions, typically associated with hotter weather, the efficiency of vapor condensation drops, reducing clean water yield.
Additionally, thermal stress under high-temperature conditions can impair the performance of key system components. This added thermal load diminishes overall efficiency, even when solar energy input is abundant.
4.2. Hydrogen Production
The hydrogen production data shown in
Figure 4 reveals clear seasonal trends, with the highest production occurring in May at 66.5 kg/h, and the lowest in December at 37.9 kg/h. The May data coincides with a period of low voltage but high current, which, coupled with the increased efficiency of the electrolyzer during this time, leads to greater hydrogen output. In contrast, the December data is characterized by high voltage and lower current, which results in reduced hydrogen production, despite the high voltage. This highlights the significant influence of voltage and current variations on the overall hydrogen production efficiency throughout the year.
4.3. PV Power Output
The power output of the solar PV system throughout the day follows a typical daily cycle, as shown in
Figure 5. Power levels rise in the morning, peak around noon, and then decrease rapidly in the late afternoon. The highest power output occurs in May, reaching a peak of 377 kW at noon, while the lowest output of 265 kW is recorded in December at the same time. This variation is directly linked to solar radiation, which is stronger during the summer months and weaker in the winter, resulting in reduced power generation.
The voltage and current trends also show seasonal variations. Voltage levels tend to be higher during winter and experience a notable drop in the summer. This reduction in voltage, particularly between May and August, is largely due to the decrease in open circuit voltage (VOC) as the ambient temperature increases. According to Jinko Solar’s specifications, VOC decreases by 0.25% for every 1 °C rise in temperature [
17]. In contrast, cooler temperatures during the winter months contribute to higher voltage levels.
As for the current, Jinko Solar panels have a positive temperature coefficient for short circuit current (Isc) of 0.046% [
17]. This means the short circuit current slightly increases with higher temperatures. Therefore, during the summer months, currents are elevated due to higher solar irradiation interacting more effectively with the panels. Conversely, in winter, current levels are lower due to the reduced intensity of sunlight.
Additionally, the temperature coefficient for maximum power (Pmax) is −0.30%, meaning the maximum power output decreases as temperature rises. While the system generates strong power under hot conditions, the overall performance does not improve at the same rate due to efficiency losses from heat. These thermal effects limit the benefits of excess solar energy, especially when downstream systems like the electrolyzer and HDH unit cannot fully utilize the available power output.
These findings emphasize the need to account for seasonal fluctuations in PV power output when designing and optimizing solar-powered systems. The predictable reduction in power generation during the winter highlights the potential benefits of integrating energy storage or backup systems to maintain consistent performance year-round.