Category Icon

Simulating a Solar Power Plant

I’ve been designing and simulating power plants with spreadsheets. I found spreadsheets to be quite effective for steady-state or average performance modeling, but I struggle when it comes to modelling rapid, real-time variations, such as the sudden drop in solar irradiance due to cloud cover and changing the configuration of the power plant takes some effort.

In a quest for more precise and flexible modeling, I turned to coding to design a power plant model based on a modular approach able to analyse its performance in small time increments. This approach enabled me to closely analyze the behavior and performance of individual components within a solar power plant, including PV panels, inverters, and battery storage.

In this article, I introduce the software architecture I developed, which accurately predicted the performance of an existing PV system in Kolwezi, DR Congo. I’ll also demonstrate how this model helps design a larger PV system capable of providing a continuous 20kW output 24/7.

Modelling Approach

For the development of this modeling system, I opted for an object-oriented (OO) Python application. This choice allowed me to break down the entire system into components, each representing the behavior of different equipment and their interfaces. An object-oriented approach offers the advantage of scalability, enabling easy expansion of the system as a whole or at the individual component level.

The selection of Python as the programming language stemmed from its relatively straightforward syntax and the wealth of available libraries. These factors greatly facilitated the structuring of the application, data processing, and presentation, ultimately expediting the development process. Python’s versatility, support community and extensive documentation were instrumental in creating a robust, flexible, and efficient modeling system.

Modelling the System

The system and its individual components are represented in the following diagram.

The key components of the system are as follows:

  1. Solar Energy Source: This component represents the source of solar energy, which serves as the primary input to the system.
  2. PV Panels: The panels are responsible for converting solar energy into electrical power.
  3. Strings: Strings aggregate the output of PV panels that are arranged in groups. They serve as connectors that channel the electrical power generated by the panels.
  4. Inverters: The inverter(s) are responsible for the conversion of direct current (DC) power generated by the PV panels into alternating current (AC) power. This AC power can be directed towards the load or stored in batteries for future use.
  5. Batteries: Batteries serve as energy storage units, capable of storing excess electrical power generated by the system or supplying power when needed.

Each of these system components is modeled as a class, allowing them to be instantiated as objects during the simulation process. This object-oriented approach enhances modularity and scalability in the system’s design, providing a robust foundation for accurate modeling and flexible expansion.

The Solar Energy Class

Within the system, the Solar Energy Class serves as a critical component responsible for modeling the behavior of the solar energy source. This class operates by generating an irradiance level at specific time stamps over the course of a year, tailored to the geographical area in question.

To determine the irradiance level for a particular location, such as Kolwezi, the model draws upon data sourced from the NSRB database. It’s important to note that this model assumes a constant irradiance level from one time stamp to the next, providing a simplified yet effective representation of solar energy input.

This Solar Energy Class is instrumental in accurately replicating the solar energy conditions for the given area, enabling precise simulations and assessments within the larger system.

The PV Panels and String Classes

Within the system, the PV Panels and String Classes play essential roles in modeling the behavior of photovoltaic panels and their aggregation into strings.

  1. PV Panel Class: This class takes solar irradiance values at specified time stamps as input and calculates the corresponding electrical power output for those time stamps. By considering the solar irradiance, the PV Panel Class accurately represents the conversion of solar energy into electrical power.
  2. String Class: A String Class represents a group of PV panels whose combined output is connected to an inverter, often an MPPT (Maximum Power Point Tracking) input. When instantiated, it is configured with a list of individual panels and calculates the collected power generated by these panels, which are assumed to be arranged in series. The String Class efficiently models the process of aggregating power from multiple panels into a single stream for further processing.

These classes are pivotal in the system’s design, allowing for detailed simulation of PV panel performance and the organization of panels into groups, thereby enhancing the system’s accuracy and scalability.

The Battery and BESS Classes

Within the system, the Battery and Battery Energy Storage System (BESS) Classes are instrumental in modeling energy storage and management.

  1. Battery Class: This class is designed to receive instructions to either store or discharge energy at a specified power level over a given time interval. The energy flow in and out of a battery is precisely modeled using ampere-hours (Ah). The Battery Class is a key element in replicating the behavior of energy storage and retrieval within the system.
  2. Battery Energy Storage System (BESS) Class: The BESS Class is responsible for managing a group of batteries. It is instantiated with a list of individual batteries, which are typically arranged in parallel. This class streamlines the management of energy storage across multiple batteries, allowing for efficient control and utilization of stored energy.

The Battery and BESS Classes are critical components of the system, enabling accurate representation of energy storage and retrieval processes and contributing to the overall flexibility and effectiveness of the design.

The Load Class

The Load Class within the system is specifically designed to model the power demand of a connected load. This class calculates and outputs the kilowatt (kW) load values at designated time stamps. By precisely replicating the power demand of a load, the Load Class plays a crucial role in simulating the interaction between the system and the connected load, particularly through the inverter.

The Load Class is a fundamental element of the system, as it accurately represents the power consumption patterns, ensuring that the system’s response to the load’s demands is faithfully modeled.

The Inverter Class

The Inverter Class within the system serves as a pivotal component responsible for managing the flow of electrical power. It takes inputs from various sources, including the power output from PV panels and/or strings, as well as energy stored in batteries or a Battery Energy Storage System (BESS). The primary function of the inverter is to facilitate the distribution of this power to a connected load.

Key aspects of the Inverter Class include:

  1. Power Flow Management: The inverter class is tasked with orchestrating the flow of power, both incoming and outgoing. It coordinates the distribution of power from the solar panels and batteries to meet the energy demand of the connected load.
  2. Load Synchronization: The inverter ensures that the power output aligns with the load’s requirements, maintaining a harmonious balance between power generation and consumption.
  3. Battery Management: When batteries are part of the system, the inverter class takes into account critical parameters such as the depth of discharge. This information is used to optimize the utilization of energy stored in the batteries.

The Inverter Class plays a central role in the system, ensuring the efficient and controlled allocation of power, ultimately providing a reliable source of electricity to the connected load.

Putting It Altogether

To operate the system effectively, the process begins with the instantiation of objects for the various classes, each configured with parameters that define their performance, quantities, and interfaces. Once the objects are set up, the simulation proceeds into a loop that systematically progresses through each time stamp, evaluating the state of these objects at each step.

Here’s how the process unfolds:

  1. Solar Energy Generation: At each step, the Solar Energy object outputs an irradiance level, representing the prevailing solar conditions for that moment.
  2. Electrical Power Conversion: The irradiance level is then converted into electrical power by the Solar Panels, effectively harnessing the energy from the sun.
  3. Power Distribution: The Inverter comes into play by orchestrating the distribution of power from the Solar Panels and/or batteries. This power is directed toward the Load or stored in the batteries, depending on the system’s immediate requirements.

This simulation loop continues, step by step, as it progresses through time stamps, accurately replicating the dynamic behavior of the solar power system. It effectively brings together the various components of the system to ensure the reliable and efficient supply of electrical power.

Simulation Results

System Configuration

I used the model to assess what what equipment and configuration do I need to meet a continuous demand of 20kW 24/7. Therefore, I simulated the demand with a load object that has a constant demand of 20kW.

The system’s configuration is a critical step in determining the equipment and setup required to meet a continuous 20kW demand 24/7. Here’s how I assessed and configured the system:

  1. Load Simulation: The first step involved simulating a load with a constant 20kW demand. This served as the benchmark for the system’s energy requirements.
  2. Solar Irradiance Data: I obtained solar irradiance data for Kolwezi for the entire year of 2019, recorded at one-hour intervals from the NSRB site. Utilizing data from the Global Solar Atlas, I simulated the power output of a 1 kW solar plant. This allowed me to evaluate the equivalent Peak Sun Hours (psh) output throughout the year, highlighting a minimum daily output of 3.7 kWh in February.
  3. Solar Panel Modeling: Using the specifications from a 620 W Jinko solar panel datasheet, I modeled the solar panel objects. To meet the load demand, we needed a minimum of 207 panels, taking into account the 3.7-hour minimum psh during February.
  4. Inverter Selection: Inverter sizing was determined by the maximum power transfer on either the input or the output side. With the 207 panels producing a peak output of 128 kW, three 50 kW inverters, each with 4 MPPT trackers and the capacity for up to 4 strings, were selected.
  5. Battery Sizing: Batteries were chosen to store excess power generated by the PV panels, ensuring a continuous 1 kW output to the load 24/7. With the load requiring 24 kWh per day, a portion of the power (±80 kWh) was transferred directly to the load, while the balance (±400 kWh) needed to be stored and released progressively.
  6. Battery Capacity: Considering a depth of discharge of 80% and a maximum charge of 90% to achieve a lifespan of at least 6000 charging cycles for an average lithium battery, the initial battery storage capacity was sized at approximately 575 kWh. This adjustment necessitated an increase in the energy output of the solar panels and their numbers to approximately 300 panels.
  7. Battery Integration: Using 100 Ah, 51.2 V LiFePO4 batteries with a round trip efficiency of 97%, 116 battery objects were initially instantiated and integrated into a single Battery Energy Storage System (BESS) object.
Figure: Solar Irradiance KWh Output for a 1KWh system in Kolwezi

The summary configuration of the initial configuration was as follows :

  • 300 panels, 620W each, arranged in 30 strings with 10 panels per string.
  • 58 x 10 kWh – 200Ah batteries, integrated into one BESS.
  • 3 x 50 kW inverters.
  • A 20 kW constant load.

Results

The initial system configuration was put to the test using solar irradiance data from Kolwezi spanning from the 1st to the 6th of January 2019. This allowed us to evaluate the system’s performance, as illustrated in the following series of figures.

The above set of figures demonstrate the conversion of solar irradiance into power output by a single solar panel and collectively by all 300 panels. They vividly portray the day-to-day variations in solar irradiance, resulting in energy production fluctuations. For instance, on the 1st of January 2019, a cumulative energy output of 650 kWh was achieved, compared to 350 kWh on the 3rd of January 2019.

The following set of figures depicts how the power received by the inverter from the solar panels (the strings) is dispatched to the load and the batteries.

In the above set of figures, we witness how the inverter manages the power received from the solar panels (the strings) and distributes it to the load and the batteries. The inverter prioritizes the load, dispatching excess power (>20kW) to the batteries. When solar panel power falls below the load’s demand, the inverter draws power from the batteries to maintain the 20kW supply to the load.

The system effectively ensures a continuous 20kW power supply to the load until the 4th and the 5th of January, when lower solar irradiance led to insufficient energy production and storage, resulting in temporary fluctuations in the load’s power supply.

The inability of the BESS system to adequately compensate the power deficit to the load is explained by the following set of figures which present the energy flow and levels of the BESS.

The above figures depict the flow of ampere-hours (Ah) in and out of the Battery Energy Storage System (BESS), as well as the total energy storage capacity and the amount available for discharge at a given time. On the 3rd of January, lower irradiance levels led to a reduced amount of excess energy stored in the BESS and the complete depletion of the BESS on the 4th. Similar circumstances arose on the 5th of January.

In essence, these results highlight the need for greater energy storage capacity to withstand periods of low irradiance. This led to the formulation of a revised system configuration.

REVISED CONFIGURATION
370 panels, 620W each, 37 strings, 10 panels per string.
65 x 10 kWh – 200Ah batteries, one BESS
3x 50 kW inverters
20 kW constant load

The output of the revised configuration is depicted in the following set of figures.

With this revised configuration, the system consistently supplied 20kW from the 1st to the 6th of January 2019, effectively overcoming the challenges posed by lower solar irradiance.

This revised setup ensures continuous, reliable power delivery and offers a robust solution to meet the specified 20kW demand around the clock. The figures showcase the system’s improved performance under these conditions.

Conclusions

In this endeavor, an object-oriented (OO) Python program was developed to design and simulate the performance of a solar power plant system, with the goal of achieving a continuous 20kW power supply 24/7. The model offered a systematic approach to design each component of a typical solar power plant, including the solar energy source, solar panels, strings, batteries, Battery Energy Storage System (BESS), inverter, and the load. The initial quantities of each component were calculated using fundamental formulae and industry rule-of-thumb guidelines.

The OO program proved invaluable in simulating the performance of the initial configuration, swiftly identifying the necessary modifications to meet the project’s objectives. The program’s adaptability was evident in the swift updates made to the OO model, specifically altering the number of solar panels and the BESS capacity to achieve the desired outcome.

This OO program-based approach resulted in an overall model that is granular, modular, and scalable. Each component within the system can be updated or replaced individually, providing a high level of flexibility and making it well-suited for maintenance and optimization. It also accommodates the introduction of new and diverse components, such as thermal energy sources (e.g., gas) and thermal power plants, expanding the application beyond solar energy to encompass a wider range of power generation technologies.

The comprehensive modeling and simulation capabilities of this OO program offer a powerful tool for the design, analysis, and optimization of power plant systems, demonstrating its potential for a broad spectrum of applications within the energy sector. The versatility and adaptability of the model make it a valuable asset for addressing the challenges and complexities of modern energy generation and management.


Posted