Reducing Energy Consumption in a Poultry Farm by Designing and Optimizing the Solar Heating/Photovoltaic System

A solar heating system is designed to reduce energy consumption in a poultry farm. According to the physics and conditions of the indoor environment of the poultry building and the effect of the poultry weather conditions, the amount of 1.37 × 108 kJ/h during the year energy is required for heating. Then, by using double-glazed windows and insulation for the exterior walls of the building in the building architecture section, the amount of energy consumption is drastically reduced, and the required annual gas consumption is equal to 11,833 m3. The surface required for the collector is recommended to supply 50% of the energy from the sun with the rest from the hybrid system. The results showed that 26 m2 of a solar collector with an optimal slope of 45 degrees, and a tank volume of 440 L and a pump discharge of 1700 kg/h are required to provide 100% of energy. To receive the maximum amount of solar energy (maximum solar fraction (SF)), a collector surface equal to 30 m2 is required. However, when the economic point of view is considered, the collector surface equivalent to 26 m2 is recommended. To establish a balance, that is, 50% of the energy from the auxiliary system and the rest from the solar system, between the use of solar energy and the use of the auxiliary system, a collector area of 16 m2 is needed. Based on this, 60 photovoltaic modules, which are 10 cells in series in 6 parallel circuits, is the most optimal mode.


Introduction
The climate around a poultry farm is one of the variables that affect poultry farming performance. Parameters, such as temperature, humidity, wind, and sunlight, are especially important in their absolute value, and their daily and seasonal variations. The heat produced by the chicken's metabolism warms the air. This effect is useful in winter to keep the poultry warm. Latent heat, or moisture, is produced in two forms: the vapor of air from the breath and water in the urine [1]. The proper temperature for poultry in an incubation period strongly depends on the age of the poultry. The required temperature at the surface where the hens are located is 90 • F (about 32.2 • C) in the first three days of hatching. Due to the vital need of heating for day-old chicks, keeping the temperature in this range is critical for the chicks. After that, for each passing day, 1 • F (0.6 • C) should be reduced from the air temperature [2]. Finally, in the fourth week, it reaches about 70 • F (21.1 • C), then remains constant [3]. Excess heat is needed when the birds do not produce enough heat to maintain the right temperature in confined poultry farms in cold climates; which accounts for the largest share of the building's energy consumption. Thus, it is becoming increasingly clear that poultry farms need more insulation to maintain heat in cold climates [4]. Breeders need to know the energy consumption of their poultry house and carefully predicted the amount of energy consumption for ventilation, heating, and cooling, which for some breeding systems is a major indicator of energy consumption. This is because at every stage of a bird's development, there is an optimum temperature at which the birds produce the best in terms of using feed energy to grow. If the birds are kept at a temperature below the desired temperature, the birds increase their feed absorption and use more feed energy to keep their bodies warm, which increases the amount of production and reduces meat production. On the other hand, if they are kept at a temperature above the desired temperature, they reduce the amount of food consumed to limit heat production, which in turn leads to less meat production. Therefore, an efficient heating system is necessary for every broiler house to maintain the required temperature throughout the year [5]. The use of renewable energy is a suitable solution to solve these problems [6]. The impact of alternative energy programs on the feasibility of solar PV systems in several solar regions in the poultry industry was examined. The results were financially beneficial [7]. In an experimental study, poultry performance was evaluated in terms of relative humidity, ammonia concentration, poultry production, feed conversion rate, required power, and production cost. Experimental results reveal that the optimum conditions for enhancing the poultry production (2.29 kg) with conversion rate (1.45 kg feed per kg gain), ammonia concentration at the fifth week (13.65 ppm), and production cost (1.12 US $/kg) are achieved by using a power operating system of flat-plate solar collector integrated with photovoltaic under 2 min fan stopping periods [8].
Masry et al. [9] investigated the effect of a heating system powered by renewable energy on poultry houses. The results showed that using Biogas increases poultry body weight/bird after 6 weeks by about 3%, and by about 4% approximately in total body weights, and increases production efficiency factor (PEF) by about 10.3% compared to a conventional system.
Zeyad et al. [10] investigated the economic feasibility analysis of a designed poultry farming zone with renewable energy resources in Bangladesh. The results showed that from the load profile, the peak load was found 26.12 kW, and the average daily consumption was found 226.36 kWh. Furthermore, renewable energy resources, such as solar and biomass energy, were utilized to develop a smart microgrid to fulfill the energy demand of the poultry farm.
Cuie et al. [11] investigated the energy, economic, and environmental assessments on hybrid renewable energy technology applied in poultry farming. The results showed that the electrical energy production from the photovoltaic array could reach 11,867 kWh per annum, whereas the heat pump thermal output is about 30,210 kWh per annum. Meanwhile, the overall gas and electrical cost of the hybrid renewable heating system are £320 and £129, respectively, which is much less than that of the gas burners system and could save £763 and £750, respectively, resulting in less than a 6-year of payback period.
In recent years, simulation methods have received much attention due to saving time and money [12]. A transient model has been designed using the TRNSYS 16.1 software to evaluate the performance of different greenhouses, and the accuracy of the proposed model is confirmed using measured data in the reference greenhouse (conventional greenhouse) [13]. Computer simulation makes it possible to predict the hourly temperature and relative humidity inside the breeding unit for each year [14]. Dynamic simulation models are needed to predict the energy consumption of climate control systems used in livestock houses [15]. Dynamic simulation models make us consider sudden changes in boundary conditions, which are usually preferred by self-made computational models that use ready-made simulation tools (e.g., TRNSYS and Energy Plus 8.4.0) due to the availability of ready-to-use tools for accurate determination of thermal behavior in livestock and boundary conditions. In addition, the degree of customizability of self-made models is high and, therefore, it has been proven that they are more compatible with specific goals [16].
Lee et al. [17] investigated the adequate capacity of ground source heat pumps in energy-saving pig farms using building energy simulation. The results showed that the ground source heat pump's total cost of ownership was the cheapest, but the installation cost was the highest.
Gargab et al. [18] investigated the energy efficiency for social buildings in Morocco by TRNsys simulation. The results showed that the glazing solution does not exceed 6% in Sustainability 2023, 15,6059 3 of 33 savings on total energy demand, including the electrical demand for domestic hot water, while insulation reaches 17% in savings in zone 4.
Lee et al. [19] investigated the dynamic energy modeling for analysis of the thermal and hygroscopic environment in a mechanically ventilated duck house. The results showed errors of 1.71% and 4.33% for the air temperature and relative humidity, respectively.
One of the most important parameters to be considered in a poultry house is the determination of heat loss and heat increase. Heat loss generally involves losses from walls, floors, and ventilation [20]. Considering the economic approach, the strong role of energy is also tangible in other industries, and, due to its importance, it has challenged researchers [21][22][23]. According to the review of the previous articles, the simulation of the use of underfloor heating systems and its optimization has not been completed, as a result, in this research, a solar heating system is designed to reduce energy consumption in a poultry farm (with a capacity of 300 pieces) and the thermal load of the building is transiently simulated in TRNSYS software. By using this system, the amount of energy consumption is greatly reduced. Additionally, the heat produced by the body of chickens, with the change of weight and its effect on the heat load of the building with the growth process of the chicken, is investigated. The solar water heater in this system is optimized for heating the hall using the floor heating system. In this study, different solar thermal collectors are investigated and the best solar collector surface is suggested to achieve maximum efficiency of solar energy.

Physics of the Problem
This research is a thermal simulation of a broiler farm in Ardestan city. Ardestan is located at 33 degrees and 23 min north latitude and 52 degrees and 22 min east longitude relative to noon Greenwich. Figure 1 shows the location of Ardestan city [24]. Gargab et al. [18] investigated the energy efficiency for social buildings in Morocco by TRNsys simulation. The results showed that the glazing solution does not exceed 6% in savings on total energy demand, including the electrical demand for domestic hot water, while insulation reaches 17% in savings in zone 4.
Lee et al. [19] investigated the dynamic energy modeling for analysis of the thermal and hygroscopic environment in a mechanically ventilated duck house. The results showed errors of 1.71% and 4.33% for the air temperature and relative humidity, respectively.
One of the most important parameters to be considered in a poultry house is the determination of heat loss and heat increase. Heat loss generally involves losses from walls, floors, and ventilation [20]. Considering the economic approach, the strong role of energy is also tangible in other industries, and, due to its importance, it has challenged researchers [21][22][23]. According to the review of the previous articles, the simulation of the use of underfloor heating systems and its optimization has not been completed, as a result, in this research, a solar heating system is designed to reduce energy consumption in a poultry farm (with a capacity of 300 pieces) and the thermal load of the building is transiently simulated in TRNSYS software. By using this system, the amount of energy consumption is greatly reduced. Additionally, the heat produced by the body of chickens, with the change of weight and its effect on the heat load of the building with the growth process of the chicken, is investigated. The solar water heater in this system is optimized for heating the hall using the floor heating system. In this study, different solar thermal collectors are investigated and the best solar collector surface is suggested to achieve maximum efficiency of solar energy.

Physics of the Problem
This research is a thermal simulation of a broiler farm in Ardestan city. Ardestan is located at 33 degrees and 23 min north latitude and 52 degrees and 22 min east longitude relative to noon Greenwich. Figure 1 shows the location of Ardestan city [24].  Figure 2 shows the physics of the present problem. The dimensions of the poultry hen house are 5 m wide and 8 m long. There are 2 inlet air vents (windows) with the dimensions of 1.90 by 1.6 m. The average height of the roof is 2.5 m and, in poultry houses with a sloping roof, the roof is covered with plastic cartons, glass wool, and metal sheets. The location of the poultry farm is east-west (due to the local wind) and the fans (hen  Figure 2 shows the physics of the present problem. The dimensions of the poultry hen house are 5 m wide and 8 m long. There are 2 inlet air vents (windows) with the dimensions of 1.90 by 1.6 m. The average height of the roof is 2.5 m and, in poultry houses with a sloping roof, the roof is covered with plastic cartons, glass wool, and metal sheets. The location of the poultry farm is east-west (due to the local wind) and the fans (hen house aerators) are in the west direction. The window is made of ordinary single-walled metal and the door is made of metal. The materials used in conventional poultry farming are 20 cm walls and use of black cement on both sides and the poultry floor is also cement. The existing heating system is the jet heater type, the number of which is in the hen house. house aerators) are in the west direction. The window is made of ordinary single-walled metal and the door is made of metal. The materials used in conventional poultry farming are 20 cm walls and use of black cement on both sides and the poultry floor is also cement. The existing heating system is the jet heater type, the number of which is in the hen house.

Mathematical Description and Solution Method
The mathematical model of indoor heat loads is based on energy and mass balance. For transient conditions, the equation can be written as follows [25]: Birds, like all warm-blooded animals, produce heat, moisture, and carbon dioxide, which are by-products of their vital activities. In all stages, the body temperature is kept approximately in the range of 40 °C to 42.8 °C. As the temperature of the hall is usually lower than this temperature, the birds continuously lose heat. If the energy to compensate for the lost heat is not available to the bird, the body temperature will drop, and the bird cannot survive for a long time. Although laying hens may lay eggs above the temperature range of 12.8 °C to 23.9 °C at maximum production, the appropriate temperature is probably closer to 23.9 °C [26]. Researchers have reported that for every 5 °C increase in ambient temperature, egg laying increases from 15 °C to 30 °C. The relative humidity at the highest temperature was 50% or less. The feed conversion factor (kilogram of feed per dozen eggs) has increased by 20% at the highest temperature because less energy from food is needed to maintain body temperature. Egg size and eggshell thickness decreases at high temperatures, and the producer must maintain the ambient temperature in a way that is economically feasible. For example, in winter, reducing feed conversion efficiency at colder ambient temperatures is less expensive than providing additional heat in laying hen halls [27].
Heat production for chickens in food deprivation and rest is approximately 2.75 calories per hour per gram of live weight. For each 1.82 kg chicken, this amount is equal to 5000 calories or 20 BTU per hour. Normal activity increases heat production and increases food consumption [28].
Due to the variability of activity and the amount of daily food consumption, two-way changes in basic heat production, which is maximum at 8 in the morning and minimum at 8 in the afternoon, and the decrease in heat production due to the decrease in activity

Mathematical Description and Solution Method
The mathematical model of indoor heat loads is based on energy and mass balance. For transient conditions, the equation can be written as follows [25]: Birds, like all warm-blooded animals, produce heat, moisture, and carbon dioxide, which are by-products of their vital activities. In all stages, the body temperature is kept approximately in the range of 40 • C to 42.8 • C. As the temperature of the hall is usually lower than this temperature, the birds continuously lose heat. If the energy to compensate for the lost heat is not available to the bird, the body temperature will drop, and the bird cannot survive for a long time. Although laying hens may lay eggs above the temperature range of 12.8 • C to 23.9 • C at maximum production, the appropriate temperature is probably closer to 23.9 • C [26]. Researchers have reported that for every 5 • C increase in ambient temperature, egg laying increases from 15 • C to 30 • C. The relative humidity at the highest temperature was 50% or less. The feed conversion factor (kilogram of feed per dozen eggs) has increased by 20% at the highest temperature because less energy from food is needed to maintain body temperature. Egg size and eggshell thickness decreases at high temperatures, and the producer must maintain the ambient temperature in a way that is economically feasible. For example, in winter, reducing feed conversion efficiency at colder ambient temperatures is less expensive than providing additional heat in laying hen halls [27].
Heat production for chickens in food deprivation and rest is approximately 2.75 calories per hour per gram of live weight. For each 1.82 kg chicken, this amount is equal to 5000 calories or 20 BTU per hour. Normal activity increases heat production and increases food consumption [28].
Due to the variability of activity and the amount of daily food consumption, two-way changes in basic heat production, which is maximum at 8 in the morning and minimum at 8 in the afternoon, and the decrease in heat production due to the decrease in activity during the dark period, the calculation of heat production for each chicken is approximate. is. In addition, when the air in the poultry house is warm, there is no heat loss due to the latent heat of evaporation in the breathing air. Therefore, heat production decreases. Of course, in winter, if the temperature of the hall reaches 1.1 • C to 4.4 • C, approximately 20% of the total heat production, it is due to this reason, and when the temperature of the hall reaches 2.8 • C, each chicken emits 30 BTU per hour [28]. One of the most important parameters that must be taken into account in the poultry breeding hall is the determination of heat loss and heat gain. Heat loss generally includes losses from walls, floors, and ventilation. Sources of heat gain include heat gain from chickens, solar heat absorption, and lighting [29].
First, the optimal thermal conditions inside the poultry house are described according to the age of the birds. Then, the relationships for calculating the thermal benefits received by the poultry house, such as the thermal benefits caused by the birds, are stated. Then, the equations and relationships needed to calculate the heat losses of the building are presented, and, finally, the heat load of the hall is calculated according to the characteristics of the building of the poultry hall, the environmental conditions, and the optimal thermal conditions inside. Figure 3 schematically shows the thermal energy balance for a poultry house [30].
during the dark period, the calculation of heat production for each chicken is approximate. is. In addition, when the air in the poultry house is warm, there is no heat loss due to the latent heat of evaporation in the breathing air. Therefore, heat production decreases. Of course, in winter, if the temperature of the hall reaches 1.1 °C to 4.4 °C, approximately 20% of the total heat production, it is due to this reason, and when the temperature of the hall reaches 2.8 °C, each chicken emits 30 BTU per hour [28].
One of the most important parameters that must be taken into account in the poultry breeding hall is the determination of heat loss and heat gain. Heat loss generally includes losses from walls, floors, and ventilation. Sources of heat gain include heat gain from chickens, solar heat absorption, and lighting [29].
First, the optimal thermal conditions inside the poultry house are described according to the age of the birds. Then, the relationships for calculating the thermal benefits received by the poultry house, such as the thermal benefits caused by the birds, are stated. Then, the equations and relationships needed to calculate the heat losses of the building are presented, and, finally, the heat load of the hall is calculated according to the characteristics of the building of the poultry hall, the environmental conditions, and the optimal thermal conditions inside. Figure 3 schematically shows the thermal energy balance for a poultry house [30]. Through Equation (2), the total heat produced by poultry can be obtained, which includes tangible heat and latent heat. The total heat generated by the chicken can be determined as follows [31]: where Qchicken is heat produced by the chicken, and mb and Ti are chicken mass [kg] and indoor temperature [K], respectively. To calculate tangible heat (Qsens), which is part of the total calculated heat of Equation (3) In poultry houses, the main losses are from walls, doors, windows, ceilings, and floors, and due to the heat load due to air conditioning. Conductive heat transfer through building walls, such as walls, ceilings, doors, windows, and glass, can be calculated from Equation (4): where U is the overall heat transfer coefficient [W/mK], Af is wall and door surface [m 2 ], and To is the outdoor temperature [K]. The overall heat transfer coefficient is determined as follows: Through Equation (2), the total heat produced by poultry can be obtained, which includes tangible heat and latent heat. The total heat generated by the chicken can be determined as follows [31]: where Q chicken is heat produced by the chicken, and m b and T i are chicken mass [kg] and indoor temperature [K], respectively. To calculate tangible heat (Q sens ), which is part of the total calculated heat of Equation (2), we can use Equation (3): Q sens = Q chicken 0.8 − 1.85 × 10 −7 (10 + T i ) 4 (3) In poultry houses, the main losses are from walls, doors, windows, ceilings, and floors, and due to the heat load due to air conditioning. Conductive heat transfer through building walls, such as walls, ceilings, doors, windows, and glass, can be calculated from Equation (4): The thermal resistance of the unit surface of each layer is determined as follows [32]: where K 1,2 is the thermal conductivity of each layer [W/mK] and X 1,2 is the thickness of each layer of the building [m]. The rate of thermal conductivity transfer from the floor in winter is determined as follows [33]: where F and P are experimentally constant factors of ambient heat loss [W/mK] and building environment [m]. The conductive heat transfer through building walls, such as walls, ceilings, doors, windows, and glass, can be calculated from Equation (9) [22]: where C i , ρ i , and q v are specific heat of the air [J/kgK], density of air kg/m 3 , total volumetric rate of airflow m 2 /s , respectively. The calculations of the total heat loss are equal to the sum of the losses expressed and are obtained as follows:  (11) According to the calculation of heat loss from Equation (10) and the calculation of thermal gain from Equation (3), the required heat load can be calculated from Equation (12): It should be noted that some sources have suggested that the total heat load required to be multiplied by a factor of 1.4 to 1.6 to account for existing uncertainties and errors [33].
The Internal Rate of Return (IRR) is the discount rate that zeroes the Net Present Value (NPV) for all cash flows of a project using the NPV formula [26]: To calculate the IRR, it is necessary to set the NPV to zero and obtain its discount rate. In other words, we can write [26]: The SF is calculated as follows [27]: That E T is the total energy required is the sum of the total solar energy received and is auxiliary energy. The steps are summarized in the form of a Flowchart (Figure 4), which shows the steps of conducting studies in this section.

solar fraction = E s E T
That E T is the total energy required is the sum of the total solar energy recei is auxiliary energy.
The steps are summarized in the form of a Flowchart (Figure 4), which sh steps of conducting studies in this section.  The simulation and optimization process of the solar electric system is shown in Figure 5. The simulation and optimization process of the solar electric system is shown in Figure 5. The basis of model used in this simulation is based on the equivalent circuit model of five parameters proposed by Duffy and Beckman [32]. This model can be solved by specifying the I-V diagram by the manufacturer of short-circuit current and open-circuit voltages in this study; it is assumed that poultry farming starts in the first hour of January. Thus, a poultry cycle takes place once every 56 days. Given that the time between each cycle is 15 to 20 days, in this study, we consider the interval between 2 cycles to be 17 days. Thus, the operation profile of the building in Figure 6 is presented hour by hour during the year. In Figure 6, the number one indicates activity and the number zero indicates the time between two cycles. Considering the complete information about the distribution of the desired temperature in the poultry house about the age of the chickens and the activity of the poultry farm, the following profile is presented hour by hour during the year about the age of the chickens and the activity of the house. As shown in this curve, the optimum temperature for keeping chickens in the first 3 days is 32.2 °C. This temperature decreases gradually during the days of operation until it reaches a constant temperature of 21.1 °C on the 21st day. The results are following Dbouk et al. [34]. In the time interval between the two operations, since the indoor temperature is not controlled and the heating system The basis of model used in this simulation is based on the equivalent circuit model of five parameters proposed by Duffy and Beckman [32]. This model can be solved by specifying the I-V diagram by the manufacturer of short-circuit current and open-circuit voltages in this study; it is assumed that poultry farming starts in the first hour of January. Thus, a poultry cycle takes place once every 56 days. Given that the time between each cycle is 15 to 20 days, in this study, we consider the interval between 2 cycles to be 17 days. Thus, the operation profile of the building in Figure 6 is presented hour by hour during the year. In Figure 6, the number one indicates activity and the number zero indicates the time between two cycles. Considering the complete information about the distribution of the desired temperature in the poultry house about the age of the chickens and the activity of the poultry farm, the following profile is presented hour by hour during the year about the age of the chickens and the activity of the house. As shown in this curve, the optimum temperature for keeping chickens in the first 3 days is 32.2 • C. This temperature decreases gradually during the days of operation until it reaches a constant temperature of 21.1 • C on the 21st day. The results are following Dbouk et al. [34]. In the time interval between the two operations, since the indoor temperature is not controlled and the heating system is turned off, and due to the disinfection of the indoor environment, the indoor doors are opened, and the indoor temperature is assumed to be equal to the outside temperature. is turned off, and due to the disinfection of the indoor environment, the indoor doors are opened, and the indoor temperature is assumed to be equal to the outside temperature.

Calculation of Heat Gain and Moisture Production of Chickens throughout the Year
Another important parameter in this simulation is the calculations related to the heat production of chickens throughout the year in relation to their age and the time of operation of the poultry house. The thermal gain of the chicken in each cycle is calculated and presented in Figure 7. This information was also evaluated for the production of moisture caused by the breathing of chickens, and the result is presented in Figure 8.

Calculation of Heat Gain and Moisture Production of Chickens throughout the Year
Another important parameter in this simulation is the calculations related to the heat production of chickens throughout the year in relation to their age and the time of operation of the poultry house. The thermal gain of the chicken in each cycle is calculated and presented in Figure 7.
is turned off, and due to the disinfection of the indoor environment, the indoor d opened, and the indoor temperature is assumed to be equal to the outside tempe

Calculation of Heat Gain and Moisture Production of Chickens throughout the Year
Another important parameter in this simulation is the calculations related to production of chickens throughout the year in relation to their age and the operation of the poultry house. The thermal gain of the chicken in each cycle is ca and presented in Figure 7. This information was also evaluated for the production of moisture caused breathing of chickens, and the result is presented in Figure 8. This information was also evaluated for the production of moisture caused by the breathing of chickens, and the result is presented in Figure 8. For thermal calculations of the system in the TRNSYS software, according to the mentioned cases, the values of heat losses and heat load required for poultry are calculated on an hourly basis. These values are for the cold seasons of the year that require heating. Thus, by using type 88 of TRNSYS software (or similar cases), and defining the physics and coefficients of heat transfer of the building and the internal heat efficiency of the building, such as the heat produced by chickens, electrical equipment, etc., as an input to the model and values. The heat load and temperature inside the building are simulated hour by hour, and when the building temperature is lower than the standard temperature of broiler poultry, the amount of heat load is evaluated. As the analytical diagram provided by TRNSYS software is in terms of power at different hours, by integrating below the surface of the curve, we can estimate the energy required to heat the building. This integration is completed on a daily, monthly, and hourly basis for further analysis. By estimating the required power and energy, the underfloor heating system can also be evaluated and designed. First, there is a need to model the weather conditions of Ardestan city, hour by hour, in the form of a tmy2 file, which can be checked in TRNSYS software. For this purpose, the geographical location and the information collected from the Meteorological Organization to model the mentioned conditions is performed using Meteonorm software. Based on this, the longitude and altitude and the nearest synoptic stations (available in the software database) are modeled during the models that are present in the software by default, and the climatic information is provided hour by hour. To validate this information, the output of this software can be compared with the monthly average of the information provided by the synoptic station in the area. Figure 9 shows the modeling of a poultry building in the current conditions. As shown in Figure 9, the climatic conditions of Ardestan city are defined as the entrance to the poultry building. To simulate the weather conditions, TRNSYS 16.1 software is used, which is a COMPONENT with the ability to read simulated weather conditions with the extension TMY2. One of the advantages of this component is the ability to calculate the intensity of scattered radiation with the PEREZ model. This model is one of the most accurate models to simulate the intensity of scattered radiation [35]. Since one of the required parts in the type 88 input of TRNSYS software is relative humidity, and the weather model of this software, which is capable of reading weather conditions, lacks relative humidity, by using a psychometric COMPONENT, Using the dry air temperature and the amount of humidity, the relative humidity has been evaluated on an hourly basis. The amount of heat generated by the chickens during each cycle, depending on their weight, is defined as the input using the DataReader COMPONENT. Other parameters affecting this section, such as humidity and heat generated by electrical equipment and lighting, are also defined in the form of a txt file to DataReader. All these conditions, For thermal calculations of the system in the TRNSYS software, according to the mentioned cases, the values of heat losses and heat load required for poultry are calculated on an hourly basis. These values are for the cold seasons of the year that require heating. Thus, by using type 88 of TRNSYS software (or similar cases), and defining the physics and coefficients of heat transfer of the building and the internal heat efficiency of the building, such as the heat produced by chickens, electrical equipment, etc., as an input to the model and values. The heat load and temperature inside the building are simulated hour by hour, and when the building temperature is lower than the standard temperature of broiler poultry, the amount of heat load is evaluated. As the analytical diagram provided by TRNSYS software is in terms of power at different hours, by integrating below the surface of the curve, we can estimate the energy required to heat the building. This integration is completed on a daily, monthly, and hourly basis for further analysis. By estimating the required power and energy, the underfloor heating system can also be evaluated and designed. First, there is a need to model the weather conditions of Ardestan city, hour by hour, in the form of a tmy2 file, which can be checked in TRNSYS software. For this purpose, the geographical location and the information collected from the Meteorological Organization to model the mentioned conditions is performed using Meteonorm software. Based on this, the longitude and altitude and the nearest synoptic stations (available in the software database) are modeled during the models that are present in the software by default, and the climatic information is provided hour by hour. To validate this information, the output of this software can be compared with the monthly average of the information provided by the synoptic station in the area. Figure 9 shows the modeling of a poultry building in the current conditions. As shown in Figure 9, the climatic conditions of Ardestan city are defined as the entrance to the poultry building. To simulate the weather conditions, TRNSYS 16.1 software is used, which is a COMPONENT with the ability to read simulated weather conditions with the extension TMY2. One of the advantages of this component is the ability to calculate the intensity of scattered radiation with the PEREZ model. This model is one of the most accurate models to simulate the intensity of scattered radiation [35]. Since one of the required parts in the type 88 input of TRNSYS software is relative humidity, and the weather model of this software, which is capable of reading weather conditions, lacks relative humidity, by using a psychometric COMPONENT, Using the dry air temperature and the amount of humidity, the relative humidity has been evaluated on an hourly basis. The amount of heat generated by the chickens during each cycle, depending on their weight, is defined as the input using the DataReader COMPONENT. Other parameters affecting this section, such as humidity and heat generated by electrical equipment and lighting, are also defined in the form of a txt file to DataReader. All these conditions, including the ones analyzed in the previous section, have been entered as parameters and type 88 inputs that can calculate the thermal load by the Lumped Capacitance method, and the conditions of the poultry building have been evaluated [36]. including the ones analyzed in the previous section, have been entered as parameters and type 88 inputs that can calculate the thermal load by the Lumped Capacitance method, and the conditions of the poultry building have been evaluated [36].

Results and Discussion
Due to the clarity of the assumptions presented in the previous section, we can perform calculations related to the heat transfer coefficient. The climatic characteristics of the place are shown in Table 1. Table 2 shows the overall result of these calculations. Additionally, in Table 3, the thermal capacity calculations of the building are shown, and, to calculate the thermal capacity of the building, we first must calculate the surface mass of the roof, wall, and floor of the building. The surface mass of the building average mass is one square meter of the surface of the outer shell of the building. The information displayed in Table 3 with variables will be examined transiently and hour by hour. This information includes information and environmental conditions and is derived from weather conditions.

Results and Discussion
Due to the clarity of the assumptions presented in the previous section, we can perform calculations related to the heat transfer coefficient. The climatic characteristics of the place are shown in Table 1. Table 2 shows the overall result of these calculations. Additionally, in Table 3, the thermal capacity calculations of the building are shown, and, to calculate the thermal capacity of the building, we first must calculate the surface mass of the roof, wall, and floor of the building. The surface mass of the building average mass is one square meter of the surface of the outer shell of the building. The information displayed in Table 3 with variables will be examined transiently and hour by hour. This information includes information and environmental conditions and is derived from weather conditions.   Figure 10a shows the indoor temperature without considering the jet heater (output type 88) and calculated by TRNSYS. As long as the indoor temperature reaches the desired temperature, the jet heater starts, then shuts off. The maximum indoor temperature is 37 • C, which occurs in the summer. The minimum temperature is −7 • C, which occurs in January.  Figure 10a shows the indoor temperature without considering the jet heater (output type 88) and calculated by TRNSYS. As long as the indoor temperature reaches the desired temperature, the jet heater starts, then shuts off. The maximum indoor temperature is 37 °C, which occurs in the summer. The minimum temperature is −7 °C, which occurs in January. Figure 10b shows the heat required in the poultry house. As shown in Figure 10b, on 1 January, which is equivalent to the remainder of January, the building needs heat. This heat requirement is met by a jet heater. Heat is needed as long as the chickens are indoors. When the chicken leaves the poultry house, the required amount of heat will be zero.  Figure 10b shows the heat required in the poultry house. As shown in Figure 10b, on 1 January, which is equivalent to the remainder of January, the building needs heat. This heat requirement is met by a jet heater. Heat is needed as long as the chickens are indoors. When the chicken leaves the poultry house, the required amount of heat will be zero.
According to Figure 10 and integrating from below the power and time curve, the amount of energy required for the hen house for annual heating in the current conditions is equal to 137,462,334 kJ per year. Considering the value of thermal gas equal to 8000 kJ/m 3 , the amount of 17,182 m 3 of gas per year is required.
To validate and increase the validity of the amount of gas consumed during one year of operation in the poultry farm, it was referred to the amount of gas consumed in this poultry farm is reported to be 15,900 m 3 . The difference between these two numbers is equal to 1282 m 3 /year. This difference is approximately equal to 8%, and one of the reasons for the deviation is the lack of accurate adjustment of the comfort temperature of the chickens.
In addition, because the value of this deviation is approximately equal to 8%, the results are documented with acceptable accuracy and can be programmed.
To reduce energy losses from external walls, the use of thermal insulation and doubleglazed windows has been proposed. Accordingly, the calculations are resumed. In this case, the amount of Building Loss Coefficient changes from 8.09 kJ/h to 5.1 kJ/h per square meter. The results of this evaluation show that if the heating system is not used for poultry, the temperature inside the poultry building in Ardestan city will change, as shown in Figure 11a. By investigating below the surface of Figure 11b, the amount of energy required for the annual heating of the hall is equal to 94,671,627.9 kJ per year, which is equal to 11,833 m 3 . Therefore, by performing these few simple operations, the annual savings will be 42,790,706 kJ per year (31%).
In the following, the economic analysis of these changes will be discussed. The cost of required insulation and the amount of insulation, and double glazing of windows and the total investment cost required are presented in Table 4.  According to Figure 10 and integrating from below the power and time curve, the amount of energy required for the hen house for annual heating in the current conditions is equal to 137,462,334 kJ per year. Considering the value of thermal gas equal to 8000 kJ/m 3 , the amount of 17,182 m 3 of gas per year is required. To validate and increase the validity of the amount of gas consumed during one year of operation in the poultry farm, it was referred to the amount of gas consumed in this poultry farm is reported to be 15,900 m 3 . The difference between these two numbers is equal to 1282 m 3 /year. This difference is approximately equal to 8%, and one of the reasons for the deviation is the lack of accurate adjustment of the comfort temperature of the chickens.
In addition, because the value of this deviation is approximately equal to 8%, the results are documented with acceptable accuracy and can be programmed.
To reduce energy losses from external walls, the use of thermal insulation and double-glazed windows has been proposed. Accordingly, the calculations are resumed. In this case, the amount of Building Loss Coefficient changes from 8.09 kJ/h to 5.1 kJ/h per square meter. The results of this evaluation show that if the heating system is not used for poultry, the temperature inside the poultry building in Ardestan city will change, as shown in Figure 11a. By investigating below the surface of Figure 11b, the amount of energy required for the annual heating of the hall is equal to 94,671,627.9 kJ per year, which is equal to 11,833 m 3 . Therefore, by performing these few simple operations, the annual savings will be 42,790,706 kJ per year (31%). In the following, the economic analysis of these changes will be discussed. The cost of required insulation and the amount of insulation, and double glazing of windows and the total investment cost required are presented in Table 4. Therefore, the simple investment return of these solutions is equal to 3.6 years, which is considered a cost-effective solution from an economic point of view.
The cross-sectional selection of the solar collector is discussed. The assumptions for all the leading designs are presented in Table 5.  Therefore, the simple investment return of these solutions is equal to 3.6 years, which is considered a cost-effective solution from an economic point of view.
The cross-sectional selection of the solar collector is discussed. The assumptions for all the leading designs are presented in Table 5.  Figure 12 shows the solar heating system simulation process using TRNSYS 16.1 software. In the mentioned model, Type 109 is used to enter the weather conditions into the model. Type 3 is also a pumping system, one used for circulation between the storage source and the solar collector, and the other to transfer the hot water produced to the underfloor heating pipes. Type 5b is a heat exchanger with an asymmetric current. A heat exchanger with an apparent heat capacity of zero is modeled as a fixed-effect device that operates independently of the system configuration. The input temperature of the cold side and the hot side and the flow rate are given as input. It should be noted that the effect is calculated for a constant value of all heat transfer coefficients. Type 6 is a side heater.
The lateral heating element is modeled to increase the fluid flow temperature using an internal, external, or combination of both controllers. Whenever the input of the external controller is equal to one or the output temperature of the heater is less than the value set by the user, the heater adds heat to the flow at the rate designed by the user (Q max ). Defining a constant value for the control function and specifying a value large enough for Q max will work similar to a home-side water heater with an internal controller to generate the output temperature. With a control function with a value of zero or one of a thermostat or controller, this operation will proceed like a furnace that adds heat at a rate of Q max , but the heat increases to the point where the outlet temperature is higher than the test value The storage source, which is Type 4, is also used to store water. It should be noted that at all collector cross sections, when the heating system is not working and we need heating, the solar heating system is producing energy and this productive energy is not consumed and is wasted. These values should be shown in the calculations as zero. Excel software is entered, and the corresponding values are deducted from the total output. These estimates are evaluated annually and hourly at all sections. The very important point in this section is that, when the poultry farm is closed, the distance between the two cycles, which is between 16 to 17 days, produces a solar water heater, which is unusable because, at that time, we do not have poultry house heating if the operation of solar energy has more production than consumption, then it is stored in this tank. the model. Type 3 is also a pumping system, one used for circulation between the storage source and the solar collector, and the other to transfer the hot water produced to the underfloor heating pipes. Type 5b is a heat exchanger with an asymmetric current. A heat exchanger with an apparent heat capacity of zero is modeled as a fixed-effect device that operates independently of the system configuration. The input temperature of the cold side and the hot side and the flow rate are given as input. It should be noted that the effect is calculated for a constant value of all heat transfer coefficients. Type 6 is a side heater. The lateral heating element is modeled to increase the fluid flow temperature using an internal, external, or combination of both controllers. Whenever the input of the external controller is equal to one or the output temperature of the heater is less than the value set by the user, the heater adds heat to the flow at the rate designed by the user (Q max ) . Defining a constant value for the control function and specifying a value large enough for Q max will work similar to a home-side water heater with an internal controller to generate the output temperature. With a control function with a value of zero or one of a thermostat or controller, this operation will proceed like a furnace that adds heat at a rate of Q max , but the heat increases to the point where the outlet temperature is higher than the test value The storage source, which is Type 4, is also used to store water. It should be noted that at all collector cross sections, when the heating system is not working and we need heating, the solar heating system is producing energy and this productive energy is not consumed and is wasted. These values should be shown in the calculations as zero. Excel software is entered, and the corresponding values are deducted from the total output. These estimates are evaluated annually and hourly at all sections. The very important point in this section is that, when the poultry farm is closed, the distance between the two cycles, which is between 16 to 17 days, produces a solar water heater, which is unusable because, at that time, we do not have poultry house heating if the operation of solar energy has more production than consumption, then it is stored in this tank. It should be noted that in all collector cross sections, when the heating system does not work when we need heating, the solar heating system produces energy and this energy is not consumed, and in the term, is thrown. These values must be shown as zero in the calculations. The output data of this section is entered into Excel 2016 software and the relevant values are deducted from the total output. These estimates are evaluated It should be noted that in all collector cross sections, when the heating system does not work when we need heating, the solar heating system produces energy and this energy is not consumed, and in the term, is thrown. These values must be shown as zero in the calculations. The output data of this section is entered into Excel 2016 software and the relevant values are deducted from the total output. These estimates are evaluated annually and hourly in all sections. An important point in this section is that when the poultry farm is closed, the interval between two cycles, which is between 16 to 17 days, produces a solar water heater, which is unusable. As, at that time, we do not need to heat the poultry house; if the operation of solar energy has more production than consumption, it will be stored in this tank.
To optimize the cross-section of the solar collector, the Barley and Balcombe method is used [37]. In this way, the SF is calculated first. SF is the amount of energy extracted from the sun in proportion to the total energy required. This expression shows how much percent of the total energy is obtained by solar energy. In this way, throughout the year, the energy extracted from the sun is calculated hour by hour, then the amount of SF is evaluated. These calculations are evaluated for the cross sections and the number of different collectors [37]. Table 6 shows the amount of solar energy gained, the required auxiliary energy, the total amount of energy required, and the SF for the different areas of the solar collector. Accordingly, if we install 2 m 2 (a solar collector), we can supply only 5.2% of the total energy by solar energy, and if we install 30 m 2 of solar collector, we will be able to receive 100% of the required energy by solar energy.  Figure 13 shows the SF value for different areas of solar collectors. As it can be seen, as the collector area increases, the SF increases. Increasing the collector area leads to an increase in the solar heat flux by the plate, which ultimately increases the SF. The behavior of the diagram up to 26 m 2 is quasi-linear, which means that using any collector area up to 26 m 2 can significantly increase the SF. As the collector area increases more, the SF increases with less sensitivity; thus, in an area of 26 m 2 , the SF is equal to 98.5% and in an area of 30 m 2 , the SF is equal to 100%. By increasing the area, the energy received by the solar collector increases, and the temperature increases. The results show that SF increases with the increase in an area [38,39]. The technically optimal point is the point at which we have maximum production from the sun. That is the point that covers the surface of 26 m 2 of the sun. Therefore, by increasing the area by more than 26 m 2 , only the cost increases.   Figure 14 shows the curve of the amount extracted from solar energy versus the amount of energy required in the auxiliary system for different areas of solar collectors. As shown in the figure, the intersection of these two curves, which is located approximately 16 m 2 of the solar collector, is where half of the energy is supplied by the sun and the other half by the auxiliary system. In the past, this point was considered the optimal point. If this is not the true optimal point, increasing solar energy gain is proportional to increasing the collector area. This curve fits with the SF. As the collector area increases, the solar energy gain increases. The auxiliary heating required behavior is exactly the opposite of the solar energy gain curve so its value decreases as the collector area increases. When the collector area increases, although it increases the cost, it reduces the need to use an auxiliary heating source and it is easy to use a renewable and clean source with a slight increase in cost. From these two curves, it is easy to strike a balance between natural and auxiliary energy sources according to the conditions. Both curves show nonlinear behavior. However, up to 10 m 2 of surface, the trend of energy extracted from the sun is uniform, and, from 10 m 2 to 16 m 2 , there is a sudden increase. There is also a linear trend from 16 m 2 to 20 m 2 and with increasing area, a sudden jump in the amount of energy extracted be seen. In order to select the optimal area, another point must be considered. This point is known as economic optimization. The point is that investing at this point, in terms of engineering economics, has the highest IRR (internal rate of return equivalent to the rate of return that an investor can earn by investing in a project) or NPV. In this section, this optimization is completed according to IRR, then a comprehensive engineering economics analysis will be performed on the selected optimal area. Figure 15 shows the amount of annual income in Dollars for different areas of collectors in m 2 . The linear trend is seen up to the area of 26 m 2 , then the slope of the chart is fixed. Figure 16 shows the investment required for each of the selected areas. This curve is drawn in terms of collector area per square meter, and investment cost in terms of Dollars. The IRR amount of the selected collectors can be obtained according to the planned investment cost and annual income. The linear trend indicates that the increase in the collector area is proportional to the increase in cost. Figure 17 shows the IRR value in percentage for different areas of the collector. As shown in the Figure above, the maximum IRR value has dropped to 26 m 2 . Therefore, technical and economic optimism has fallen exactly at the same point. As the area increases, the IRR value begins to decrease. The minimum IRR value occurs per minimum area. From 6 m 2 to 25 m 2 , a linear trend for IRR is evident. In an earlier study, the performance of PVT systems, solar collectors, heat pumps, etc., to provide lighting In order to select the optimal area, another point must be considered. This point is known as economic optimization. The point is that investing at this point, in terms of engineering economics, has the highest IRR (internal rate of return equivalent to the rate of return that an investor can earn by investing in a project) or NPV. In this section, this optimization is completed according to IRR, then a comprehensive engineering economics analysis will be performed on the selected optimal area. Figure 15 shows the amount of annual income in Dollars for different areas of collectors in m 2 . The linear trend is seen up to the area of 26 m 2 , then the slope of the chart is fixed. Figure 16 shows the investment required for each of the selected areas. This curve is drawn in terms of collector area per square meter, and investment cost in terms of Dollars. The IRR amount of the selected collectors can be obtained according to the planned investment cost and annual income. The linear trend indicates that the increase in the collector area is proportional to the increase in cost. Figure 17 shows the IRR value in percentage for different areas of the collector. As shown in the Figure above, the maximum IRR value has dropped to 26 m 2 . Therefore, technical and economic optimism has fallen exactly at the same point. As the area increases, the IRR value begins to decrease. The minimum IRR value occurs per minimum area. From 6 m 2 to 25 m 2 , a linear trend for IRR is evident. In an earlier study, the performance of PVT systems, solar collectors, heat pumps, etc., to provide lighting and heating energy for a poultry farm was investigated [20]. The study showed that more than 85% of the energy savings of this poultry farm is provided by this system, and this system can have a return-on-investment equivalent to 3 to 5 years. The main difference between that research and this research is that, first, in the other research [40], the conditions are not seen transiently, also the city under study is different. The difference between the studied cities affects the intensity of ambient radiation to extract thermal energy from the sun. In addition, in this study, no research has been completed on thermal energy storage [40].    Table 7 shows a summary of the calculations presented in this section. It is necessary to optimize the slope value. The results of the researchers showed the slope of the collector affects energy consumption [41,42]. Figure 18 also shows amount of energy extracted from the sun relative to different slopes. As it can be see the slope increases to 47%, the total solar energy received increases.
It was shown that the inclination angle strongly affects the performance of collector. The average heat transfer coefficient decreases with increasing inclination an This fact suggests that too high an inclination angle is not recommended for s collectors [43]. A slope of 47% is the best case as it can use solar energy, and the effici of the system can be at this maximum. With the increasing slope, more than 47% received energy decreases. The use of sloping surfaces can lead to more radiation in Ardestan region, especially in the cold months of the year.  Table 7 shows a summary of the calculations presented in this section. It is necessary to optimize the slope value. The results of the researchers showed that the slope of the collector affects energy consumption [41,42]. Figure 18 also shows the amount of energy extracted from the sun relative to different slopes. As it can be seen, as the slope increases to 47%, the total solar energy received increases.
It was shown that the inclination angle strongly affects the performance of the collector. The average heat transfer coefficient decreases with increasing inclination angle. This fact suggests that too high an inclination angle is not recommended for solar collectors [43]. A slope of 47% is the best case as it can use solar energy, and the efficiency of the system can be at this maximum. With the increasing slope, more than 47%, the received energy decreases. The use of sloping surfaces can lead to more radiation in the Ardestan region, especially in the cold months of the year. In the slope optimization section, first, the amount of total energy that can be extracted from the sun has been measured in different slopes, and their results are presented in Table 8. As shown in Figure 18, the optimal slope in this land-use occurs at 47 degrees in this area. The initial 45 degrees conjecture is very close to reality and the calculations in the previous step are sufficiently valid. In the following, the optimal flow rate through the solar system is calculated. For this purpose, for a surface of 26 m 2 and a slope of 47 degrees, we pass different flow rates and estimate the amount of energy extracted from the sun, and, finally, the maximum point is the appropriate flow rate for the pump. Volumetric and mass flow rates have an impact on the performance of solar collectors. Different flow rates cause different efficiencies. Accordingly, choosing the optimum flow rate in every collector should be considered one of the significant factors in selecting and using the collectors. There are many studies about the effect of flow rate on a collector's efficiency [44,45]. A higher flow rate leads to greater efficiency, but a higher flow rate necessitates higher pump power and a larger tube diameter (to maintain laminar flow), both of which raise installation costs. As a result, it is necessary to control and obtain the appropriate flow rate. In the mass flow optimization section of the pump, first, the amount of total energy extractable from the sun in different discharges has been measured, and their results are shown in Figure 19. As the flow rate increases to 1700 kg/h, the total energy received from the sun increases, then a relative decrease is observed. However, the effect of increasing the flow on the total energy received from the sun to a In the slope optimization section, first, the amount of total energy that can be extracted from the sun has been measured in different slopes, and their results are presented in Table 8. As shown in Figure 18, the optimal slope in this land-use occurs at 47 degrees in this area. The initial 45 degrees conjecture is very close to reality and the calculations in the previous step are sufficiently valid. In the following, the optimal flow rate through the solar system is calculated. For this purpose, for a surface of 26 m 2 and a slope of 47 degrees, we pass different flow rates and estimate the amount of energy extracted from the sun, and, finally, the maximum point is the appropriate flow rate for the pump. Volumetric and mass flow rates have an impact on the performance of solar collectors. Different flow rates cause different efficiencies. Accordingly, choosing the optimum flow rate in every collector should be considered one of the significant factors in selecting and using the collectors. There are many studies about the effect of flow rate on a collector's efficiency [44,45]. A higher flow rate leads to greater efficiency, but a higher flow rate necessitates higher pump power and a larger tube diameter (to maintain laminar flow), both of which raise installation costs. As a result, it is necessary to control and obtain the appropriate flow rate. In the mass flow optimization section of the pump, first, the amount of total energy extractable from the sun in different discharges has been measured, and their results are shown in Figure 19. As the flow rate increases to 1700 kg/h, the total energy received from the sun increases, then a relative decrease is observed. However, the effect of increasing the flow on the total energy received from the sun to a flow of 1200 kg/hr is very significant and is observed after a gentle upward trend. However, the two main factors of slope and flow rate can be effective in receiving the total solar energy, the role of flow rate is more tangible. As shown in Figure 19, the optimal flow occurs in this use and this area at the point of 1700 kg per hour. According to this case, the optimal flow of the pump is selected, and the pump is placed in the optimal position. Individual components are needed recalculate this collector area with optimal conditions and calculate the volume of the new tank.
Sustainability 2023, 15, x FOR PEER REVIEW 22 o flow of 1200 kg/hr is very significant and is observed after a gentle upward tre However, the two main factors of slope and flow rate can be effective in receiving the t solar energy, the role of flow rate is more tangible. As shown in Figure 19, the opti flow occurs in this use and this area at the point of 1700 kg per hour. According to case, the optimal flow of the pump is selected, and the pump is placed in the opti position. Individual components are needed recalculate this collector area with opti conditions and calculate the volume of the new tank. In the mass flow optimization section of the pump, first, the amount of total ene that can be extracted from the sun has been measured at different flow rates, and t results are presented in Table 9.  Table 10 shows the overall conclusion for this system. As it is clear in the table, w the final optimization measures, the solar fraction has increased from 98.5% to 99.7%. volume of the tank is also equal to 440 L. With these interpretations, there is almos need for auxiliary energy. In the mass flow optimization section of the pump, first, the amount of total energy that can be extracted from the sun has been measured at different flow rates, and their results are presented in Table 9.  Table 10 shows the overall conclusion for this system. As it is clear in the table, with the final optimization measures, the solar fraction has increased from 98.5% to 99.7%. The volume of the tank is also equal to 440 L. With these interpretations, there is almost no need for auxiliary energy.

Simulating the Photovoltaic System to Supply the Hall with Electricity
In this part of the research, the photovoltaic system is investigated to supply electricity to the hall. It should be noted that, since the price of buying electricity from the grid is much cheaper than the selling price of photovoltaic electricity, in this project, the entire produced electricity is sold to the grid and the required electricity of the complex is purchased from the grid. Figure 20 shows the process of the system under study in TRNSYS software.

Simulating the Photovoltaic System to Supply the Hall with Electricity
In this part of the research, the photovoltaic system is investigated to supply electricity to the hall. It should be noted that, since the price of buying electricity from the grid is much cheaper than the selling price of photovoltaic electricity, in this project, the entire produced electricity is sold to the grid and the required electricity of the complex is purchased from the grid. Figure 20 shows the process of the system under study in TRNSYS software. The technical specifications of the desired photovoltaic are presented in Table 11. It should be noted that this type of monocrystalline silicon system, which is the most widely used and commercial type of photovoltaic cell, has been used. The technical specifications of the desired photovoltaic are presented in Table 11. It should be noted that this type of monocrystalline silicon system, which is the most widely used and commercial type of photovoltaic cell, has been used. Now, the amount of electricity required in different parts of the hall is examined. These sections are lighting, underfloor heating pump, ventilation fan, auxiliary burner fan, solar water heater pump, and miscellaneous applications, the process of which is shown in Figure 21.  Table 12 shows the technical specifications of the mechanical equipment used in the system.   Table 12 shows the technical specifications of the mechanical equipment used in the system. The area of each photovoltaic module is equal to 0.89 m 2 . Therefore, in this section, the number of 30 photovoltaic modules is examined. It should be noted that 10 cells have been used in series in 3 parallel circuits. In addition, according to the manufacturer's recommendation, 10 series are allowed in each parallel circuit in all cross-sections of the mentioned photovoltaic systems [46]. It shows the summary of the results of using the photovoltaic system. Table 13 shows the amount of electricity produced by photovoltaics, the amount of electricity required in the hall, the purchase price of electricity, the sale price of electricity, the annual income, the required investment cost, and, finally, the IRR index for the cross-sectional area. Based on this, the graph of Figure 22 is presented based on the amount of total power production for a different area of the photovoltaic system. of electricity, the annual income, the required investment cost, and, finally, the IRR index for the cross-sectional area.
Based on this, the graph of Figure 22 is presented based on the amount of total power production for a different area of the photovoltaic system.     of electricity, the annual income, the required investment cost, and, finally, the IRR index for the cross-sectional area.
Based on this, the graph of Figure 22 is presented based on the amount of total power production for a different area of the photovoltaic system.       Figure 25 shows the IRR rate for a different area of the photovoltaic system. As it is clear in the IRR curve, the optimal point is in the section where the IRR is most upward-sloping. This point shows the number of 6 circuits with 10 series modules, a total of 60 with an area of 53.4 m 2 . In the following section, the calculations of the optimal cross-sectional area for photovoltaic cells are discussed. The review is presented in Table  13.    Figure 25 shows the IRR rate for a different area of the photovoltaic system. As it is clear in the IRR curve, the optimal point is in the section where the IRR is most upward-sloping. This point shows the number of 6 circuits with 10 series modules, a total of 60 with an area of 53.4 m 2 . In the following section, the calculations of the optimal cross-sectional area for photovoltaic cells are discussed. The review is presented in Table  13.  As it is clear in the IRR curve, the optimal point is in the section where the IRR is most upward-sloping. This point shows the number of 6 circuits with 10 series modules, a total of 60 with an area of 53.4 m 2 . In the following section, the calculations of the optimal cross-sectional area for photovoltaic cells are discussed. The review is presented in Table 13. Table 14 summarizes the optimal conditions for the photovoltaic system under study. To validate the calculations made in this section, using PVSOL software, the mentioned photovoltaic system was designed, and the results of the calculations are presented below. For this purpose, 60 panels with similar specifications to the simulated model in TRNSYS software were evaluated. The diagram in Figure 26 of the proposed PVSOL software model is based on this.  Table 14 summarizes the optimal conditions for the photovoltaic system under study. To validate the calculations made in this section, using PVSOL software, the mentioned photovoltaic system was designed, and the results of the calculations are presented below. For this purpose, 60 panels with similar specifications to the simulated model in TRNSYS software were evaluated. The diagram in Figure 26 of the proposed PVSOL software model is based on this.  Figure 26, 10 panels are used in parallel and a total of 60 panels (6 parallel circuits) are used. Based on this, the annual energy production chart was evaluated, and it was found that the amount of energy produced by these panels is equal to 13,116 kWh per year. This value is estimated at 14,247 kWh in TRNSYS software. The deviation of these two software from each other is less than 1%, so the accuracy of calculations is high and acceptable. Figure 27 shows the power generation curve in PV and inverter systems. As can be seen, the energy from the inverter is always more than the energy produced from the PV array in all months. For both cases, the maximum and minimum system variant is related to the 8th and 11th months, respectively. In the first quarter of the year and the third quarter of the year, the changes are increasing in a regular pattern. However, in the fourth and tenth months, the variant system decreases and in the  Figure 26, 10 panels are used in parallel and a total of 60 panels (6 parallel circuits) are used. Based on this, the annual energy production chart was evaluated, and it was found that the amount of energy produced by these panels is equal to 13,116 kWh per year. This value is estimated at 14,247 kWh in TRNSYS software. The deviation of these two software from each other is less than 1%, so the accuracy of calculations is high and acceptable. Figure 27 shows the power generation curve in PV and inverter systems. As can be seen, the energy from the inverter is always more than the energy produced from the PV array in all months. For both cases, the maximum and minimum system variant is related to the 8th and 11th months, respectively. In the first quarter of the year and the third quarter of the year, the changes are increasing in a regular pattern. However, in the fourth and tenth months, the variant system decreases and in the eleventh month, a sharp decline is seen. In both cases, the third quarter of the year seems to have a high potential and the fourth quarter of the year has the lowest potential. Table 15 shows the results of these calculations for the areas of 2 m 2 , 4 m 2 , and 6 m 2 , respectively.

As shown in
Due to the electricity purchase rate being much lower than the renewable electricity sale rate to the grid, the scenario of selling the entire electricity to the grid and buying electricity separately was proposed. Based on this, the number of 60 solar panels in 6 parallel sections, each of which had 10 in series, was identified as the best case. Economic analysis of this solution using RET Screen Expert Professional 8.0.1.31, this solution is not economical under any heading due to the IRR below the bank rate and negative NPV.
Among the research that have been completed, very few studies have been completed in relation to energy storage in poultry farms. eleventh month, a sharp decline is seen. In both cases, the third quarter of the year seems to have a high potential and the fourth quarter of the year has the lowest potential. Figure 27. Electric power generation curve in PV and system inverter. Table 15 shows the results of these calculations for the areas of 2 m 2 , 4 m 2 , and 6 m 2 , respectively. Due to the electricity purchase rate being much lower than the renewable electricity sale rate to the grid, the scenario of selling the entire electricity to the grid and buying electricity separately was proposed. Based on this, the number of 60 solar panels in 6 parallel sections, each of which had 10 in series, was identified as the best case. Economic  Dbuok et al. [34] investigated the solar-heated poultry house in BEKAA town. The results showed that the tested system managed to provide the different temperatures required for rearing chickens during the winter of 2019, where the temperature ranged from 32 • C during week 1 to 18 • C during week 6. This solar heating system with a cross-sectional area of 6 m 2 saves 60% of heating costs when using traditional heating methods. In the present research, the cross-sectional area of 18 m 2 in the city of Ardestan with the mentioned poultry farming conditions has a saving value of 60%. The reasons for the difference between these two poultry farms are as follows: - The first difference investigated in the village of Beka in Lebanon is the climatic conditions of the region. According to the investigation, the Heating Degree Days in Bekah city is equal to 443 days, while in Ardestan city, it is equal to 2038 days.

-
The difference in weather conditions is another reason for the difference caused by these two chicken farms. - The difference in the dimensions of the hall and the number of poultry used in the poultry farm. -Another difference between this system and the system investigated in this research is the use of radiators instead of floor heating. The underfloor heating system can work at a lower temperature. Also, because this system spreads evenly throughout the building, it has much higher comfort and efficiency compared to the radiator system.
Li et al. [47] investigated the performance of PVT systems, solar collectors, heat pumps, etc. to provide lighting and heating energy for a chicken farm. Their study showed that more than 85% of the savings in the energy consumption of this poultry farm was provided by this system and this system can have a return-on-investment equivalent to 3 to 5 years. The main difference between the previous research and this research is that the conditions were not seen transiently, and the city under investigation is different. The difference between the investigated cities affects the intensity of ambient radiation to extract thermal energy from the sun. In addition, in this research, there has been no investigation regarding thermal energy storage.
Also, in other studies that have been completed, the role of the angle and surface of the collector in solar fraction has been investigated. Table 16 shows the comparison between the research results and this research. According to Table 16, it can be seen that good studies have been completed on the use and application of solar energy for the poultry industry, but most of the studies focus on reducing environmental effects, identifying strategies to improve performance and implementing systems with the aim of supplying electricity to poultry farming, and helping to increase network electricity. In this research, a solar heating system has been designed to reduce energy consumption in a poultry farm (with a capacity of 300 pieces). By using this system, the amount of energy consumption is greatly reduced. The solar water heater in this system is optimized for heating the hall using the floor heating system. In this study, different solar thermal collectors are investigated, and the best solar collector surface is suggested to achieve maximum efficiency of solar energy.

Conclusions
In this research and modeling, several innovations have not been investigated with this precision in any research so far. These investigations include: A. Hour-by-hour dynamic simulation of the chicken breeding hall. B. Calculation of the heat produced by the body of chickens with the change of weight and its effect on the heat load of the building with the growth process of the chicken. C. Calculating the humidity produced by the body of chickens by changing the weight and its effect on the humidity produced and ventilation of the building with the growing process of chickens.
Considering the mentioned cases in this research, the findings were presented with much higher accuracy.
The results were generally analyzed in two architectural sections, solar thermal system and solar electric system, transiently (hour by hour) in TRNSYS software, then in RETSCREEN software, engineering economics analysis was completed for each. The findings that can be obtained are as follows: -A total of 1.37 × 10 8 kJ/h of power is needed to heat the study hall for one year (this amount is equal to 17,180 m 3 of natural gas). - The use of double-glazed windows and insulation for the exterior walls of the building leads to a significant reduction in energy. -Using the proposed solutions, the required annual gas consumption can be reduced to 11,833 m 3 . -To achieve optimal conditions, 26 m 2 of a solar collector with a slope of 47 degrees (taking into account the volume of the tank 440 L and pump flow of 1700 kg/h) is required. - The solar system with 26 m 2 and an optimal slope of 47 • , and, taking into account the tank volume of 440 lit and the pump flow rate of 1700 kg/h, has the most optimal conditions for providing 100% energy. By analyzing the engineering economy in RETSCREEN software, it was found that the internal interest rate of using this solution, if the hall is equipped with underfloor heating, is equal to 34.1%. If we consider the cost of equipping this hall to install the underfloor heating system, the internal interest rate of this solution is equal to 27.9%.
Optimally for a photovoltaic system, 60 solar panels in 6 parallel sections, each with 10 in series, are required for the network.
In the following, it is suggested to evaluate different types of solar collectors, such as parabolic collectors and EVACUTED TUBE collectors, and the effect of using different collectors in future research. In addition, it is suggested that because in the summer the indoor temperature reached a higher value than the ideal conditions for raising chickens (in this research, 38 • C), the use of cheap cooling systems to increase breeding efficiency should be evaluated and analyzed. In addition, in this research, the effect of preparing the optimal temperature on the efficiency of the herd is not taken into account, which can help to make the designs more economical. This case can also be considered by researchers in future research.
The limitations in this research are mostly related to the lack of scientific and correct exploitation of poultry halls. As this work is completed traditionally, most of the property owners do not have large enough operation to exploit large poultry halls. For example, in the hall, chickens of different ages are not paid special attention, and in addition, due to the use of non-standard heating systems, the farmers cannot have proper control of different environments. These devices, such as jet heaters or rockets and similar things, create heat at one point, then direct it to different areas of the hall utilizing a fan. This causes non-uniform production of heat inside the hall.
In addition to the problem mentioned in the previous section, the problem with halls that are managed traditionally is improper ventilation. Sometimes in these halls, due to improper ventilation, dust and humidity rise in the hall and deviate from the standard conditions.
Overcrowding, stress, aggressiveness, and high losses are the consequences of these issues. The above cases reduce the efficiency of the herd and mortality, and reduce the profitability of the breeder.