Skip to content

Commit

Permalink
fix: don't report Power Supply Onshore if no cable loss
Browse files Browse the repository at this point in the history
  • Loading branch information
jsolaas committed Oct 15, 2024
1 parent 28d4d3b commit 719bd93
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 62 deletions.
4 changes: 4 additions & 0 deletions src/libecalc/presentation/exporter/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def get_electricity_production(self, unit: Unit) -> AttributeSet:
assert isinstance(fuel_consumer_result, GeneratorSetResult)
consumer_category = TemporalModel(fuel_consumer.user_defined_category)
for period, category in consumer_category.items():
if category == "POWER-FROM-SHORE" and fuel_consumer.cable_loss is None:
# Edge case; we don't want to assume cable loss = 0 if power from shore. So we skip reporting produced electricity if cable loss isn't specified
continue

if fuel_consumer.cable_loss is not None:
# TODO: Move this calculation into generator set
cable_loss = self._installation_graph.variables_map.evaluate(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
forecastYear forecastMonth turbineFuelGasConsumption flareGasConsumption engineDieselConsumption turbineFuelGasCo2Mass flareGasCo2Mass engineDieselCo2Mass co2VentingMass turbineFuelGasNoxMass flareGasNoxMass engineDieselNoxMass turbineFuelGasNmvocMass flareGasNmvocMass engineDieselNmvocMass coldVentAndFugitivesNmvocMass storageNmvocMass loadingNmvocMass turbineFuelGasCh4Mass flareGasCh4Mass engineDieselCh4Mass coldVentAndFugitivesCh4Mass storageCh4Mass loadingCh4Mass loadedAndStoredOil gasTurbineGeneratorConsumption gasTurbineCompressorConsumption offshoreWindConsumption fromShoreConsumption powerSupplyOnshore steamTurbineGeneratorConsumption
#Years Months Fuel Consumption[Sm3] Flare Gas[Sm3] Diesel Consumption[L] CO2 From Fuel Gas[t] CO2 From Flare[t] CO2 From Diesel[t] CO2 From Cold Venting Fugitives[t] NOX From Fuel Gas[t] NOX From Flare[t] NOX From Diesel[t] NMVOC From Fuel Gas[t] NMVOC From Flare[t] NMVOC From Diesel[t] NMVOC From Cold Venting Fugitives[t] NMVOC From Storage[t] NMVOC From Loading[t] CH4 From Fuel Gas[t] CH4 From Flare[t] CH4 From Diesel[t] CH4 From Cold Venting Fugitives[t] CH4 From Storage[t] CH4 From Loading[t] Total Oil Loaded/Stored[Sm3] Total Electricity Generated[GWh] Total Power Consumed By Gas-Turbine Driven Compressors[GWh] Total Electricity Consumed From Offshore Wind[GWh] Total Electricity Consumed From Power-From-Shore[GWh] Power Supply Onshore[GWh] Total Electricity Consumed From Steam Turbine Generators[GWh]
2021 01 33446253 5475000 3889000 70571.61 14235 10539.19 0 306.3675 7.665036 118.6144 8.027098 0.328555 8.633489 38.32487 0 229.9502 30.43615 1.313909 0 131.3999 0 21.89993 1095000 122.3545 0 0 74.46 74.46 7.446
2022 01 693967871 3650000 3518600 1464272 9490 9535.405 0 6356.745 5.110128 107.3173 166.5526 0.218887 7.811172 43.06989 0 229.9501 631.5108 0.87588 0 153.3002 0 21.89998 1095000 130.9912 50.34694 0 79.716 79.716 7.9716
2023 01 533925379 3650000 3518600 1126583 9490 9535.405 0 4890.757 5.110128 107.3173 128.1428 0.218887 7.811172 43.43492 0 214.6201 485.8723 0.87588 0 156.9498 0 20.43985 1022000 130.9912 66.29014 0 79.716 79.716 7.9716
2024 01 311313735 5490000 3806400 656872 14274 10315.34 0 2851.634 7.686037 116.0951 74.71564 0.329455 8.450098 42.82198 0 192.15 283.2951 1.317509 0 151.8899 0 18.30015 914999.9 122.6897 410.5339 32.85216 41.81184 41.81184 7.4664
2025 01 411507899 3650001 3591600 868281.6 9490.002 9733.236 0 3769.412 5.109883 109.5438 98.76234 0.219 7.973352 44.895 0 306.6 374.4718 0.876 0 160.5999 0 29.19988 1460000 138.1886 681.5524 37.00224 47.09376 47.09376 8.4096
2026 01 292912595 3650001 3591600 618045.6 9490.002 9733.236 0 2683.08 5.109883 109.5438 70.29935 0.219 7.973352 45.26012 0 459.9 266.5507 0.876 0 163.155 0 43.8 2190000 138.1886 468.6232 37.00224 47.09376 47.09376 8.4096
2027 01 234469407 3650001 3650001 494730.5 9490.002 9891.505 0 2147.74 5.109883 111.3249 56.27249 0.219 8.103 45.62488 0 268.275 213.3673 0.876 0 163.8849 0 25.55012 1277500 138.1886 354.3396 37.00224 47.09376 47.09376 8.4096
2028 01 177817904 5489999 2562000 375195.8 14274 6943.021 0 1628.812 7.686117 78.14112 42.67624 0.329488 5.687611 43.55391 0 153.7201 161.8146 1.317629 0 155.916 0 14.64015 731999.9 125.3475 325.7012 34.01165 43.28755 43.28755 7.72992
2029 01 192263657 3650001 2190000 405676.3 9490.002 5934.9 0 1761.135 5.109883 66.795 46.14348 0.219 4.8618 45.26012 0 137.97 174.96 0.876 0 161.6949 0 13.14 657000 134.7266 354.3396 37.00224 47.09376 47.09376 8.4096
2030 01 191916726 3650001 2190000 404944.3 9490.002 5934.9 0 1757.958 5.109883 66.795 46.06008 0.219 4.8618 45.62488 0 124.173 174.6446 0.876 0 163.155 0 11.826 591300 133.0609 354.3396 37.00224 47.09376 47.09376 8.4096
2031 01 177606484 3650001 2190000 374749.7 9490.002 5934.9 0 1626.876 5.109883 66.795 42.62546 0.219 4.8618 45.62488 0 111.7555 161.622 0.876 0 163.155 0 10.6434 532170 131.5041 347.7193 37.00224 47.09376 47.09376 8.4096
2032 01 157104083 5489999 2562000 331489.6 14274 6943.021 0 1439.074 7.686117 78.14112 37.70494 0.329488 5.687611 43.55391 0 100.8403 142.9649 1.317629 0 155.916 0 9.603781 480192 119.4056 316.8373 34.01165 43.28755 43.28755 7.72992
2033 01 27668241 0 0 58380 0 0 0 253.441 0 0 6.640445 0 0 0 0 0 25.17807 0 0 0 0 0 0 43.8 0 0 87.6 87.6 8.76
forecastYear forecastMonth turbineFuelGasConsumption flareGasConsumption engineDieselConsumption turbineFuelGasCo2Mass flareGasCo2Mass engineDieselCo2Mass co2VentingMass turbineFuelGasNoxMass flareGasNoxMass engineDieselNoxMass turbineFuelGasNmvocMass flareGasNmvocMass engineDieselNmvocMass coldVentAndFugitivesNmvocMass storageNmvocMass loadingNmvocMass turbineFuelGasCh4Mass flareGasCh4Mass engineDieselCh4Mass coldVentAndFugitivesCh4Mass storageCh4Mass loadingCh4Mass loadedAndStoredOil gasTurbineGeneratorConsumption gasTurbineCompressorConsumption offshoreWindConsumption fromShoreConsumption steamTurbineGeneratorConsumption
#Years Months Fuel Consumption[Sm3] Flare Gas[Sm3] Diesel Consumption[L] CO2 From Fuel Gas[t] CO2 From Flare[t] CO2 From Diesel[t] CO2 From Cold Venting Fugitives[t] NOX From Fuel Gas[t] NOX From Flare[t] NOX From Diesel[t] NMVOC From Fuel Gas[t] NMVOC From Flare[t] NMVOC From Diesel[t] NMVOC From Cold Venting Fugitives[t] NMVOC From Storage[t] NMVOC From Loading[t] CH4 From Fuel Gas[t] CH4 From Flare[t] CH4 From Diesel[t] CH4 From Cold Venting Fugitives[t] CH4 From Storage[t] CH4 From Loading[t] Total Oil Loaded/Stored[Sm3] Total Electricity Generated[GWh] Total Power Consumed By Gas-Turbine Driven Compressors[GWh] Total Electricity Consumed From Offshore Wind[GWh] Total Electricity Consumed From Power-From-Shore[GWh] Total Electricity Consumed From Steam Turbine Generators[GWh]
2021 01 33446253 5475000 3889000 70571.61 14235 10539.19 0 306.3675 7.665036 118.6144 8.027098 0.328555 8.633489 38.32487 0 229.9502 30.43615 1.313909 0 131.3999 0 21.89993 1095000 122.3545 0 0 74.46 7.446
2022 01 693967871 3650000 3518600 1464272 9490 9535.405 0 6356.745 5.110128 107.3173 166.5526 0.218887 7.811172 43.06989 0 229.9501 631.5108 0.87588 0 153.3002 0 21.89998 1095000 130.9912 50.34694 0 79.716 7.9716
2023 01 533925379 3650000 3518600 1126583 9490 9535.405 0 4890.757 5.110128 107.3173 128.1428 0.218887 7.811172 43.43492 0 214.6201 485.8723 0.87588 0 156.9498 0 20.43985 1022000 130.9912 66.29014 0 79.716 7.9716
2024 01 311313735 5490000 3806400 656872 14274 10315.34 0 2851.634 7.686037 116.0951 74.71564 0.329455 8.450098 42.82198 0 192.15 283.2951 1.317509 0 151.8899 0 18.30015 914999.9 122.6897 410.5339 32.85216 41.81184 7.4664
2025 01 411507899 3650001 3591600 868281.6 9490.002 9733.236 0 3769.412 5.109883 109.5438 98.76234 0.219 7.973352 44.895 0 306.6 374.4718 0.876 0 160.5999 0 29.19988 1460000 138.1886 681.5524 37.00224 47.09376 8.4096
2026 01 292912595 3650001 3591600 618045.6 9490.002 9733.236 0 2683.08 5.109883 109.5438 70.29935 0.219 7.973352 45.26012 0 459.9 266.5507 0.876 0 163.155 0 43.8 2190000 138.1886 468.6232 37.00224 47.09376 8.4096
2027 01 234469407 3650001 3650001 494730.5 9490.002 9891.505 0 2147.74 5.109883 111.3249 56.27249 0.219 8.103 45.62488 0 268.275 213.3673 0.876 0 163.8849 0 25.55012 1277500 138.1886 354.3396 37.00224 47.09376 8.4096
2028 01 177817904 5489999 2562000 375195.8 14274 6943.021 0 1628.812 7.686117 78.14112 42.67624 0.329488 5.687611 43.55391 0 153.7201 161.8146 1.317629 0 155.916 0 14.64015 731999.9 125.3475 325.7012 34.01165 43.28755 7.72992
2029 01 192263657 3650001 2190000 405676.3 9490.002 5934.9 0 1761.135 5.109883 66.795 46.14348 0.219 4.8618 45.26012 0 137.97 174.96 0.876 0 161.6949 0 13.14 657000 134.7266 354.3396 37.00224 47.09376 8.4096
2030 01 191916726 3650001 2190000 404944.3 9490.002 5934.9 0 1757.958 5.109883 66.795 46.06008 0.219 4.8618 45.62488 0 124.173 174.6446 0.876 0 163.155 0 11.826 591300 133.0609 354.3396 37.00224 47.09376 8.4096
2031 01 177606484 3650001 2190000 374749.7 9490.002 5934.9 0 1626.876 5.109883 66.795 42.62546 0.219 4.8618 45.62488 0 111.7555 161.622 0.876 0 163.155 0 10.6434 532170 131.5041 347.7193 37.00224 47.09376 8.4096
2032 01 157104083 5489999 2562000 331489.6 14274 6943.021 0 1439.074 7.686117 78.14112 37.70494 0.329488 5.687611 43.55391 0 100.8403 142.9649 1.317629 0 155.916 0 9.603781 480192 119.4056 316.8373 34.01165 43.28755 7.72992
2033 01 27668241 0 0 58380 0 0 0 253.441 0 0 6.640445 0 0 0 0 0 25.17807 0 0 0 0 0 0 43.8 0 0 87.6 8.76
Original file line number Diff line number Diff line change
Expand Up @@ -463,22 +463,6 @@
"12":"43.28755",
"13":"87.6"
},
"powerSupplyOnshore":{
"0":"Power Supply Onshore[GWh]",
"1":"74.46",
"2":"79.716",
"3":"79.716",
"4":"41.81184",
"5":"47.09376",
"6":"47.09376",
"7":"47.09376",
"8":"43.28755",
"9":"47.09376",
"10":"47.09376",
"11":"47.09376",
"12":"43.28755",
"13":"87.6"
},
"steamTurbineGeneratorConsumption":{
"0":"Total Electricity Consumed From Steam Turbine Generators[GWh]",
"1":"7.446",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
forecastYear forecastMonth turbineFuelGasConsumption turbineFuelGasCo2Mass turbineFuelGasNoxMass turbineFuelGasNmvocMass turbineFuelGasCh4Mass gasTurbineGeneratorConsumption fromShoreConsumption powerSupplyOnshore
#Years Months Fuel Consumption[Sm3] CO2 From Fuel Gas[t] NOX From Fuel Gas[t] NMVOC From Fuel Gas[t] CH4 From Fuel Gas[t] Total Electricity Generated[GWh] Total Electricity Consumed From Power-From-Shore[GWh] Power Supply Onshore[GWh]
2021 01 0 0 0 0 0 0 0 0
2022 01 50156012 105829.2 459.4292 12.03745 45.64206 159.432 0 0
2023 01 0 0 0 0 0 0 159.432 159.432
2024 01 0 0 0 0 0 0 149.328 149.328
2025 01 0 0 0 0 0 0 168.192 168.192
2026 01 0 0 0 0 0 0 168.192 168.192
2027 01 0 0 0 0 0 0 168.192 168.192
2028 01 0 0 0 0 0 0 154.5984 154.5984
2029 01 0 0 0 0 0 0 168.192 168.192
2030 01 0 0 0 0 0 0 168.192 168.192
2031 01 0 0 0 0 0 0 168.192 168.192
2032 01 0 0 0 0 0 0 154.5984 154.5984
2033 01 0 0 0 0 0 0 175.2 175.2
forecastYear forecastMonth turbineFuelGasConsumption turbineFuelGasCo2Mass turbineFuelGasNoxMass turbineFuelGasNmvocMass turbineFuelGasCh4Mass gasTurbineGeneratorConsumption fromShoreConsumption
#Years Months Fuel Consumption[Sm3] CO2 From Fuel Gas[t] NOX From Fuel Gas[t] NMVOC From Fuel Gas[t] CH4 From Fuel Gas[t] Total Electricity Generated[GWh] Total Electricity Consumed From Power-From-Shore[GWh]
2021 01 0 0 0 0 0 0 0
2022 01 50156012 105829.2 459.4292 12.03745 45.64206 159.432 0
2023 01 0 0 0 0 0 0 159.432
2024 01 0 0 0 0 0 0 149.328
2025 01 0 0 0 0 0 0 168.192
2026 01 0 0 0 0 0 0 168.192
2027 01 0 0 0 0 0 0 168.192
2028 01 0 0 0 0 0 0 154.5984
2029 01 0 0 0 0 0 0 168.192
2030 01 0 0 0 0 0 0 168.192
2031 01 0 0 0 0 0 0 168.192
2032 01 0 0 0 0 0 0 154.5984
2033 01 0 0 0 0 0 0 175.2
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,5 @@
"11":"168.192",
"12":"154.5984",
"13":"175.2"
},
"powerSupplyOnshore":{
"0":"Power Supply Onshore[GWh]",
"1":"0",
"2":"0",
"3":"159.432",
"4":"149.328",
"5":"168.192",
"6":"168.192",
"7":"168.192",
"8":"154.5984",
"9":"168.192",
"10":"168.192",
"11":"168.192",
"12":"154.5984",
"13":"175.2"
}
}

0 comments on commit 719bd93

Please sign in to comment.