architecture-building-systems / CityEnergyAnalyst

The City Energy Analyst (CEA)
https://www.cityenergyanalyst.com/
MIT License
188 stars 59 forks source link

no potential for some buildings in SC and PVT, creating problems in optimization beta #3434

Open yiqiaowang-arch opened 7 months ago

yiqiaowang-arch commented 7 months ago

Describe the bug When running optimization beta script, I received an error about one building (B302011886) and the optimization wouldn't continue. I looked into the solar potential files and found out that solar collector (SC) yield for this building is almost always nan. Example of SC potential result: image

B302011886 info: image Possible reasons could be that I set the inflow temperature to default (75°C), and the solar radiation is just not strong enough to heat up the water, so no yield is generated. This building is a parking lot and is very small, hidden among other buildings, causing it to not gain enough radiation. (But I also set the installation threshold of PVT and SC to be above 800kWh/m2a, so it should not consider this building in the beginning.) In the following output generated by optimization beta script, some other buildings also have problems in their PVT or SC results, but the script did not stop on those buildings (for example, B302060757). B302060757 info: image

Expected Behaviour I would first expect the SC or PVT script to generate correct output according to the radiation threshold. Then, if a building is totally unable to produce any heat, it should be correctly considered in the optimization beta script. Below are example SC and PVT files that doesn't have a valid output: solar potential two buildings.zip

Error:

City Energy Analyst version 3.34.2
Running `cea optimization-new` with the following parameters:
- general:debug = False
  (default: False)
- general:scenario = C:\Users\wangy\OneDrive\ETHY2FW\IDP_Personal\CEA\2050 w3
  (default: {general:project}\{general:scenario-name})
- general:multiprocessing = True
  (default: True)
- general:number-of-cpus-to-keep-free = 1
  (default: 1)
- optimization-new:network-type = DH
  (default: DH)
- optimization-new:cooling-components = ['absorption_chillers', 'unitary_air_conditioners', 'vapor_compression_chillers']
  (default: ['vapor_compression_chillers', 'absorption_chillers', 'unitary_air_conditioners'])
- optimization-new:heating-components = ['cogeneration_plants', 'heat_pumps', 'boilers']
  (default: ['cogeneration_plants', 'heat_pumps', 'boilers'])
- optimization-new:heat-rejection-components = ['cooling_towers']
  (default: ['cooling_towers'])
- optimization-new:maximum-number-of-networks = 3
  (default: 2)
- optimization-new:objective-functions = ['cost', 'GHG_emissions']
  (default: ['system_energy_demand', 'anthropogenic_heat'])
- optimization-new:generate-detailed-outputs = False
  (default: False)
- optimization-new:available-energy-sources = ['power_grid']
  (default: ['power_grid', 'fossil_fuels', 'bio_fuels'])
- optimization-new:available-energy-potentials = ['photovoltaic_panels', 'photovoltaic_thermal_panels', 'solar_thermal_panels', 'geothermal_energy', 'sewage']
  (default: ['photovoltaic_panels', 'photovoltaic_thermal_panels', 'solar_thermal_panels', 'geothermal_energy', 'water_bodies', 'sewage'])
- optimization-new:component-efficiency-model-complexity = constant
  (default: constant)
- optimization-new:systems-algorithm = NSGAIII
  (default: NSGAIII)
- optimization-new:systems-mutation-method = PolynomialBounded
  (default: PolynomialBounded)
- optimization-new:systems-crossover-method = Uniform
  (default: Uniform)
- optimization-new:networks-algorithm = NSGAIII
  (default: NSGAIII)
- optimization-new:networks-mutation-method = UniformInteger
  (default: UniformInteger)
- optimization-new:networks-crossover-method = Uniform
  (default: Uniform)
- optimization-new:ga-population-size = 15
  (default: None)
- optimization-new:ga-number-of-generations = 3
  (default: 3)
- optimization-new:ga-mutation-prob = 0.1
  (default: 0.1)
- optimization-new:ga-crossover-prob = 0.3
  (default: 0.3)
- optimization-new:ga-mutation-eta = 0.5
  (default: 0.5)
- optimization-new:min-head-substation = 20.0
  (default: 20.0)
- optimization-new:hw-friction-coefficient = 100
  (default: 100)
- optimization-new:peak-load-velocity = 2.0
  (default: 2.0)
- optimization-new:equivalent-length-factor = 0.2
  (default: 0.2)
- optimization-new:peak-load-percentage = 100.0
  (default: 100.0)
- optimization-new:network-lifetime = 20.0
  (default: 20.0)
Time elapsed for loading buildings in domain: 24.826355695724487 s
There seems to be a problem with the SolarPVT potential of building B302060757! Please check the corresponding .csv-file.
There seems to be a problem with the SolarCollectorET potential of building B302060757! Please check the corresponding .csv-file.
There seems to be a problem with the SolarCollectorET potential of building B302011740! Please check the corresponding .csv-file.
There seems to be a problem with the SolarCollectorET potential of building B302019762! Please check the corresponding .csv-file.
There seems to be a problem with the SolarCollectorET potential of building B302011910! Please check the corresponding .csv-file.
There seems to be a problem with the SolarCollectorET potential of building B302012172! Please check the corresponding .csv-file.
There seems to be a problem with the SolarCollectorET potential of building B302011895! Please check the corresponding .csv-file.
There seems to be a problem with the SolarCollectorET potential of building B3020659791! Please check the corresponding .csv-file.
No SolarCollectorFP potentials could be found for the indicated buildings. If you would like to include potentials, consider running potentials scripts and then rerun the optimisation.
Time elapsed for loading energy potentials: 17.62878656387329 s

Initializing domain:
1. Creating available supply system components...
2. Finding possible network paths (this may take a while)...
3. Establishing district energy system structure...
Traceback (most recent call last):
  File "c:\users\wangy\documents\cityenergyanalyst\cityenergyanalyst\cea\worker.py", line 146, in worker
    run_job(config, job, server)
  File "c:\users\wangy\documents\cityenergyanalyst\cityenergyanalyst\cea\worker.py", line 108, in run_job
    script(config=config, **parameters)
  File "c:\users\wangy\documents\cityenergyanalyst\cityenergyanalyst\cea\api.py", line 60, in __call__
    self._runner.__call__(*args, **kwargs)
  File "c:\users\wangy\documents\cityenergyanalyst\cityenergyanalyst\cea\api.py", line 38, in script_runner
    script_module.main(config)
  File "c:\users\wangy\documents\cityenergyanalyst\cityenergyanalyst\cea\optimization_new\domain.py", line 572, in main
    current_domain.optimize_domain()
  File "c:\users\wangy\documents\cityenergyanalyst\cityenergyanalyst\cea\optimization_new\domain.py", line 141, in optimize_domain
    building_energy_potentials = Building.distribute_building_potentials(self.energy_potentials, self.buildings)
  File "c:\users\wangy\documents\cityenergyanalyst\cityenergyanalyst\cea\optimization_new\building.py", line 194, in distribute_building_potentials
    if potential.main_potential.energy_carrier.code in building_energy_potentials[building].keys():
KeyError: 'B302011886'

4. Defining possible connectivity vectors...

Calculating operation of buildings' base-supply systems...
MatNif commented 7 months ago

Hi @yiqiaowang-arch

Thanks for bringing up this issue and sorry for the late reply. Would you mind sending me your case in a zip folder? It would facilitate debugging.

yiqiaowang-arch commented 7 months ago

Hi @MatNif, here is my input folder of my setup. inputs.zip I'm sorry for the late reply (as we were focusing on other tasks during the last week) and hope this helps with the issue.