2023 May Cup (Question C) Full Analysis of Carbon Neutrality Problem Modeling Code

Problem restatement

In the background, we learned that "double carbon" refers to the abbreviation of carbon peak and carbon neutrality. my country strives to achieve carbon peak before 2030 and achieve carbon neutrality before 2060. In order to achieve this goal, our country has accelerated the pace of reducing carbon emissions and vigorously promoted green and low-carbon technological innovation. Low-carbon building is an important way to achieve the "double carbon" goal. It is committed to reducing the use of fossil energy, improving energy efficiency, and reducing carbon dioxide emissions throughout the entire life cycle of building materials and equipment manufacturing, construction, and building use. .

Question one

To solve this problem, we first need to calculate the heating and cooling needs of the building each month. We can then calculate the corresponding electrical energy consumption and finally convert the electrical energy consumption into carbon emissions.

First, we need to calculate the heat transfer coefficients of walls, roofs, doors, windows and floors.

However, these coefficients are not provided in the question and we will use the following commonly used values ​​for calculation:

  • Thermal conductivity coefficient of brick-concrete structure wall: 1.4 W/m·K
  • Thermal conductivity of reinforced concrete roof: 2.0 W/m·K
  • Thermal conductivity coefficient of doors and windows: 2.5 W/m·K
  • Thermal conductivity of concrete floor: 1.6 W/m·K

The total heat transfer area of ​​the building is:

  • Wall: 2 * (4 + 3) * 3 = 42 m²
  • Roof: 4 * 3 = 12 m²
  • Doors and windows: 5 m²
  • Floor: 4 * 3 = 12 m²

Next, we calculate monthly heating and cooling needs.

We can determine needs by comparing outdoor temperatures to temperature standards inside the building.

When the monthly average temperature is below 18 degrees, heating is required;

When the monthly average temperature is higher than 26 degrees, cooling is required.

For each month, we can calculate the heat loss or heat gain through walls, roofs, doors, windows, and floors, and then calculate electrical energy consumption based on the performance coefficients of cooling and heating.

The performance coefficients of cooling and heating are EER (Energy Efficiency Ratio, refrigeration energy efficiency ratio) and COP (Coefficient of Performance, heat pump performance coefficient) respectively. These two coefficients respectively represent the ratio of the unit cooling or heat generated by the air conditioner during cooling and heating to the unit electricity consumed.

When calculating electrical energy consumption, we can obtain electrical energy consumption based on the heat loss or heat gain divided by the corresponding performance coefficient. The following is the specific calculation method:

  1. Heating (heating): Heating is required when the monthly average temperature is below 18°C. Calculate the temperature difference (18 - average monthly outdoor temperature), and then calculate the heat loss (heat pump performance coefficient × thermal conductivity coefficient × temperature difference). Next, divide the heat loss by the COP (heat pump coefficient of performance) to get the electrical energy consumption.
  2. Refrigeration: When the monthly average temperature is higher than 26°C, refrigeration is required. Calculate the temperature difference (monthly average outdoor temperature - 26), and then calculate the heat gain (heat transfer area × thermal conductivity coefficient × temperature difference). Next, divide the heat gain by the EER (refrigeration energy efficiency ratio) to get the electrical energy consumption.

In this way, we can get the monthly electricity consumption. Adding up the electricity consumption for all months gives you the total electricity consumption required for the building to regulate its temperature through air conditioning during the year. Then, multiply the total electrical energy consumption by the carbon emission coefficient generated per kilowatt hour of electricity (0.28 kg/kWh in this question) to obtain the annual carbon emissions of the building through air conditioning to adjust the temperature.

Finally, we can convert electrical energy consumption into carbon emissions.

Since the calculation process is cumbersome, we only give an example:

  • January: The average outdoor temperature is -1°C and heating is required. The temperature difference is (18 - (-1)) = 19℃.
  • Heat loss = heat conduction area * thermal conductivity coefficient * temperature difference = (42 * 1.4 + 12 * 2 + 5 * 2.5 + 12 * 1.6) * 19 = 1417.3 W
  • Electrical energy consumption = heat loss / COP = 1417.3 / 3.5 = 404.93 Wh
  • Carbon emissions = Electricity consumption * 0.28 kg/kWh = 404.93 * 0.28 = 113.38 kg

Similarly, carbon emissions can be calculated for other months. Finally, the carbon emissions from all months are added up to get the annual carbon emissions from the building's temperature controlled by air conditioning.

Sample code

import numpy as np
 ​
 monthly_avg_temps = np.array([-1, 2, 6, 12, 22, 28, 31, 32, 26, 23, 15, 2])
 ​
 # 热导系数
 wall_conductivity = 1.4
 roof_conductivity = 2.0
 window_conductivity = 2.5
 floor_conductivity = 1.6
 ​
 # 热传导面积
 wall_area = 2 * (4 + 3) * 3
 roof_area = 4 * 3
 window_area = 5
 floor_area = 4 * 3
 ​
 # 性能系数
 COP = 3.5
 EER = 2.7
 ​
 def calculate_carbon_emission(monthly_avg_temp):
     if monthly_avg_temp < 18:
         temp_diff = 18 - monthly_avg_temp
         heat_loss = (wall_area * wall_conductivity + roof_area * roof_conductivity + 
                      window_area * window_conductivity + floor_area * floor_conductivity) * temp_diff
         electricity_consumption = heat_loss / COP
     elif monthly_avg_temp > 26:
         temp_diff = monthly_avg_temp - 26
         heat_gain = (wall_area * wall_conductivity + roof_area * roof_conductivity + 
                      window_area * window_conductivity + floor_area * floor_conductivity) * temp_diff
         electricity_consumption = heat_gain / EER
     else:
         electricity_consumption = 0
     
     carbon_emission = electricity_consumption * 0.28
     return carbon_emission
 ​
 total_carbon_emission = sum([calculate_carbon_emission(temp) for temp in monthly_avg_temps])
 print("Total yearly carbon emission:", total_carbon_emission, "kg")
 ​

First import the numpy library and define the monthly average temperature, thermal conductivity coefficient, heat transfer area and performance coefficient. Next, a function called calculate_carbon_emission is defined, which calculates the carbon emissions for the month based on the average monthly temperature. Finally, by calling this function for each month's average temperature and adding the results, the annual carbon emissions of the building heated by air conditioning are calculated.

Numpy is the third library of Python. Please install and run it on Baidu.

More details can be found here:

2023 May Cup (Question C) Full Analysis of Carbon Neutrality Problem Modeling Code

Guess you like

Origin blog.csdn.net/qq_25834913/article/details/132496817