diff --git a/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_biomass.gql b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_biomass.gql new file mode 100644 index 0000000000..fb565ca4d5 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_biomass.gql @@ -0,0 +1,12 @@ +# This query must be balanced and return 0. The loss query is not created by the script, the rest of the queries rely on queries that the rake task creates. + +- query = + SUM( + NEG(Q(turk_sankey_conversion_biomass_input)), + Q(turk_sankey_conversion_biomass_output), + NEG(Q(turk_sankey_final_demand_biomass_input)), + Q(turk_sankey_primary_demand_biomass_output), + NEG(Q(conversion_loss_biomass_products_to_biomass_products)) + ) +- unit = PJ + diff --git a/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_electricity.gql b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_electricity.gql new file mode 100644 index 0000000000..a068bfd42c --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_electricity.gql @@ -0,0 +1,12 @@ +# This query must be balanced and return 0. The loss query is not created by the script, the rest of the queries rely on queries that the rake task creates. + +- query = + SUM( + NEG(Q(turk_sankey_conversion_electricity_input)), + Q(turk_sankey_conversion_electricity_output), + NEG(Q(turk_sankey_final_demand_electricity_input)), + Q(turk_sankey_primary_demand_electricity_output), + NEG(Q(conversion_loss_electricity_to_electricity)) + ) +- unit = PJ + diff --git a/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_hydrogen.gql b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_hydrogen.gql new file mode 100644 index 0000000000..ba38e5f479 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_hydrogen.gql @@ -0,0 +1,12 @@ +# This query must be balanced and return 0. The loss query is not created by the script, the rest of the queries rely on queries that the rake task creates. + +- query = + SUM( + NEG(Q(turk_sankey_conversion_hydrogen_input)), + Q(turk_sankey_conversion_hydrogen_output), + NEG(Q(turk_sankey_final_demand_hydrogen_input)), + Q(turk_sankey_primary_demand_hydrogen_output), + NEG(Q(conversion_loss_hydrogen_to_hydrogen)) + ) +- unit = PJ + diff --git a/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_natural_gas.gql b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_natural_gas.gql new file mode 100644 index 0000000000..802b6d8a26 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_natural_gas.gql @@ -0,0 +1,11 @@ +# This query must be balanced and return 0. The loss query is not created by the script, the rest of the queries rely on queries that the rake task creates. + +- query = + SUM( + NEG(Q(turk_sankey_conversion_natural_gas_input)), + Q(turk_sankey_conversion_natural_gas_output), + NEG(Q(turk_sankey_final_demand_natural_gas_input)), + Q(turk_sankey_primary_demand_natural_gas_output), + NEG(Q(conversion_loss_natural_gas_to_natural_gas)) + ) +- unit = PJ \ No newline at end of file diff --git a/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_oil.gql b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_oil.gql new file mode 100644 index 0000000000..8caa53d417 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_oil.gql @@ -0,0 +1,12 @@ +# This query must be balanced and return 0. The loss query is not created by the script, the rest of the queries rely on queries that the rake task creates. + +- query = + SUM( + NEG(Q(turk_sankey_conversion_oil_input)), + Q(turk_sankey_conversion_oil_output), + NEG(Q(turk_sankey_final_demand_oil_input)), + Q(turk_sankey_primary_demand_oil_output), + NEG(Q(conversion_loss_oil_and_derivatives_to_oil_and_derivatives)) + ) +- unit = PJ + diff --git a/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_steam_hot_water.gql b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_steam_hot_water.gql new file mode 100644 index 0000000000..6a9ae870b8 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/tests/turk_sankey_steam_hot_water.gql @@ -0,0 +1,10 @@ +# This query must be balanced and return 0. The loss query is not created by the script, the rest of the queries rely on queries that the rake task creates. + +- query = + SUM( + Q(turk_sankey_conversion_steam_hot_water_output), + NEG(Q(turk_sankey_final_demand_steam_hot_water_input)), + Q(turk_sankey_primary_demand_steam_hot_water_output), + NEG(Q(conversion_loss_steam_hot_water_to_steam_hot_water)) + ) +- unit = PJ \ No newline at end of file diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_ammonia_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_ammonia_input.gql new file mode 100644 index 0000000000..69520e5809 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_ammonia_input.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(imported_ammonia_to_hydrogen_prod_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_biomass_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_biomass_input.gql new file mode 100644 index 0000000000..eda7ab1de9 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_biomass_input.gql @@ -0,0 +1,8 @@ +- query = + SUM( + Q(biomass_products_for_biomass_gasification_conversion), + Q(biomass_products_for_biomass_gasification_ccs_conversion), + Q(biomass_products_for_electricity_conversion), + Q(biomass_products_to_central_heat_prod_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_biomass_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_biomass_output.gql new file mode 100644 index 0000000000..e38602d9d8 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_biomass_output.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(conversion_industry_residual_greengas) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_coal_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_coal_input.gql new file mode 100644 index 0000000000..9329aa9c1f --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_coal_input.gql @@ -0,0 +1,6 @@ +- query = + SUM( + Q(coal_for_electricity_conversion), + Q(coal_and_derivatives_to_central_heat_prod_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_electricity_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_electricity_input.gql new file mode 100644 index 0000000000..0f8f3e01fe --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_electricity_input.gql @@ -0,0 +1,14 @@ +- query = + SUM( + Q(electricity_for_steam_methane_reformer_hydrogen_conversion), + Q(electricity_for_steam_methane_reformer_ccs_hydrogen_conversion), + Q(electricity_for_autothermal_reformer_hydrogen_conversion), + Q(electricity_for_autothermal_reformer_ccs_hydrogen_conversion), + Q(electricity_prod_to_p2g_in_sankey), + Q(wind_to_hydrogen_prod_in_sankey), + Q(solar_to_hydrogen_prod_in_sankey), + Q(electricity_prod_to_p2h_central_heat_in_sankey), + Q(electricity_prod_to_central_heat_prod_excl_p2h_in_sankey), + Q(electricity_for_synthetic_kerosene_conversion) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_electricity_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_electricity_output.gql new file mode 100644 index 0000000000..fd72f95369 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_electricity_output.gql @@ -0,0 +1,10 @@ +- query = + SUM( + Q(coal_products_in_source_of_electricity_production), + Q(oil_in_source_of_electricity_production), + Q(nuclear_in_source_of_electricity_production), + Q(biomass_products_in_source_of_electricity_production), + Q(gas_in_source_of_electricity_production), + Q(hydrogen_in_source_of_electricity_production) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_geothermal_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_geothermal_input.gql new file mode 100644 index 0000000000..ee818b4f31 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_geothermal_input.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(geothermal_for_central_heat_conversion) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_hydrogen_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_hydrogen_input.gql new file mode 100644 index 0000000000..f0be8d0f17 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_hydrogen_input.gql @@ -0,0 +1,7 @@ +- query = + SUM( + Q(hydrogen_for_electricity_conversion), + Q(hydrogen_for_central_heat_conversion), + Q(hydrogen_for_synthetic_kerosene_conversion) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_hydrogen_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_hydrogen_output.gql new file mode 100644 index 0000000000..b56d5fdeb1 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_hydrogen_output.gql @@ -0,0 +1,17 @@ +- query = + SUM( + Q(p2g_to_hydrogen_prod_in_sankey), + Q(direct_electrolysis_wind_in_source_of_hydrogen_production), + Q(direct_electrolysis_solar_in_source_of_hydrogen_production), + Q(steam_methane_reformer_in_source_of_hydrogen_production), + Q(steam_methane_reformer_ccs_in_source_of_hydrogen_production), + Q(autothermal_reformer_in_source_of_hydrogen_production), + Q(autothermal_reformer_ccs_in_source_of_hydrogen_production), + Q(ammonia_reformer_in_source_of_hydrogen_production), + Q(lohc_reformer_in_source_of_hydrogen_production), + Q(liquid_hydrogen_regasifier_in_source_of_hydrogen_production), + Q(biomass_gasification_in_source_of_hydrogen_production), + Q(biomass_gasification_ccs_in_source_of_hydrogen_production), + Q(conversion_industry_residual_hydrogen) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_liquid_hydrogen_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_liquid_hydrogen_input.gql new file mode 100644 index 0000000000..06a65c5e9c --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_liquid_hydrogen_input.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(conversion_from_imported_liquid_hydrogen_to_hydrogen) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_lohc_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_lohc_input.gql new file mode 100644 index 0000000000..320c761562 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_lohc_input.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(conversion_from_imported_lohc_to_hydrogen) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_loss_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_loss_input.gql new file mode 100644 index 0000000000..eda9d3ebb2 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_loss_input.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(conversion_loss_steam_hot_water_to_steam_hot_water) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_loss_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_loss_output.gql new file mode 100644 index 0000000000..72936e63de --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_loss_output.gql @@ -0,0 +1,34 @@ +- query = + SUM( + Q(conversion_loss_electricity_to_hydrogen), + Q(conversion_loss_electricity_to_steam_hot_water), + Q(conversion_loss_electricity_to_oil_and_derivatives), + Q(conversion_loss_electricity_to_natural_gas_and_derivatives), + Q(conversion_loss_electricity_to_biomass_products), + Q(conversion_loss_electricity_to_electricity), + Q(conversion_loss_hydrogen_to_electricity), + Q(conversion_loss_hydrogen_to_steam_hot_water), + Q(conversion_loss_hydrogen_to_oil_and_derivatives), + Q(conversion_loss_hydrogen_to_hydrogen), + Q(conversion_loss_uranium_to_electricity), + Q(conversion_loss_coal_and_derivatives_to_electricity), + Q(conversion_loss_coal_and_derivatives_to_steam_hot_water), + Q(conversion_loss_coal_and_derivatives_to_coal_and_derivatives), + Q(conversion_loss_oil_and_derivatives_to_electricity), + Q(conversion_loss_oil_and_derivatives_to_steam_hot_water), + Q(conversion_loss_oil_and_derivatives_to_oil_and_derivatives), + Q(conversion_loss_natural_gas_and_derivatives_to_electricity), + Q(conversion_loss_natural_gas_and_derivatives_to_steam_hot_water), + Q(conversion_loss_natural_gas_and_derivatives_to_hydrogen), + Q(conversion_loss_natural_gas_and_derivatives_to_biomass_products), + Q(conversion_loss_natural_gas_and_derivatives_to_natural_gas_and_derivatives), + Q(conversion_loss_biomass_products_to_electricity), + Q(conversion_loss_biomass_products_to_steam_hot_water), + Q(conversion_loss_biomass_products_to_hydrogen), + Q(conversion_loss_biomass_products_to_natural_gas_and_derivatives), + Q(conversion_loss_biomass_products_to_biomass_products), + Q(conversion_loss_ammonia_to_hydrogen), + Q(conversion_loss_lohc_to_hydrogen), + Q(conversion_loss_liquid_hydrogen_to_hydrogen) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_natural_gas_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_natural_gas_input.gql new file mode 100644 index 0000000000..33fdf2ec37 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_natural_gas_input.gql @@ -0,0 +1,12 @@ +- query = + SUM( + Q(gas_for_electricity_conversion), + Q(natural_gas_to_central_heat_prod_in_sankey), + Q(natural_gas_for_steam_methane_reformer_conversion), + Q(natural_gas_for_steam_methane_reformer_ccs_conversion), + Q(natural_gas_for_autothermal_reformer_conversion), + Q(natural_gas_for_autothermal_reformer_ccs_conversion), + Q(natural_gas_for_biomass_gasification_conversion), + Q(natural_gas_for_biomass_gasification_ccs_conversion) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_natural_gas_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_natural_gas_output.gql new file mode 100644 index 0000000000..429c375248 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_natural_gas_output.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(conversion_industry_residual_natural_gas) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_oil_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_oil_input.gql new file mode 100644 index 0000000000..f4ce2e0f45 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_oil_input.gql @@ -0,0 +1,6 @@ +- query = + SUM( + Q(oil_for_electricity_conversion), + Q(oil_and_derivatives_to_central_heat_prod_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_oil_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_oil_output.gql new file mode 100644 index 0000000000..c5a0dfd24b --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_oil_output.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(kerosene_synthetic_to_distribution_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_solar_thermal_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_solar_thermal_input.gql new file mode 100644 index 0000000000..86bd665945 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_solar_thermal_input.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(solar_for_central_heat_conversion) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_steam_hot_water_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_steam_hot_water_output.gql new file mode 100644 index 0000000000..81521a5d67 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_steam_hot_water_output.gql @@ -0,0 +1,16 @@ +- query = + SUM( + Q(p2h_central_heat_to_central_heat_in_sankey), + Q(chp_in_source_of_central_heat_production), + Q(electricity_excl_p2h_in_source_of_central_heat_production), + Q(hydrogen_in_source_of_central_heat_production), + Q(coal_and_derivatives_in_source_of_central_heat_production), + Q(oil_and_derivatives_in_source_of_central_heat_production), + Q(natural_gas_in_source_of_central_heat_production), + Q(biomass_products_in_source_of_central_heat_production), + Q(solar_thermal_in_source_of_central_heat_production), + Q(geothermal_in_source_of_central_heat_production), + Q(ambient_heat_excl_p2h_in_source_of_central_heat_production), + Q(residual_heat_for_central_heat_conversion) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_uranium_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_uranium_input.gql new file mode 100644 index 0000000000..54f6c0eeb8 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_conversion_uranium_input.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(uranium_for_electricity_conversion) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_ammonia_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_ammonia_input.gql new file mode 100644 index 0000000000..f9042a4ef4 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_ammonia_input.gql @@ -0,0 +1,17 @@ +- query = + SUM( + Q(sankey_final_demand_of_ammonia_in_households_space_heating_and_hot_water_energetic), + Q(sankey_final_demand_of_ammonia_in_households_other_energetic), + Q(sankey_final_demand_of_ammonia_in_buildings_space_heating_energetic), + Q(sankey_final_demand_of_ammonia_in_buildings_other_energetic), + Q(imported_ammonia_to_agriculture_in_sankey), + Q(sankey_final_demand_of_ammonia_in_industry_other_energetic), + Q(sankey_final_demand_of_ammonia_in_industry_ict_energetic), + Q(imported_ammonia_to_transport_in_sankey), + Q(imported_ammonia_to_bunkers_in_sankey), + Q(imported_ammonia_to_export_in_sankey), + Q(imported_ammonia_to_other_in_sankey), + Q(imported_ammonia_to_energy_in_sankey), + Q(imported_ammonia_to_feedstock_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_biomass_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_biomass_input.gql new file mode 100644 index 0000000000..7ac5552e9a --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_biomass_input.gql @@ -0,0 +1,17 @@ +- query = + SUM( + Q(sankey_final_demand_of_biomass_products_in_households_space_heating_and_hot_water_energetic), + Q(sankey_final_demand_of_biomass_products_in_households_other_energetic), + Q(sankey_final_demand_of_biomass_products_in_buildings_space_heating_energetic), + Q(sankey_final_demand_of_biomass_products_in_buildings_other_energetic), + Q(biomass_products_to_agriculture_in_sankey), + Q(sankey_final_demand_of_biomass_products_in_industry_other_energetic), + Q(sankey_final_demand_of_biomass_products_in_industry_ict_energetic), + Q(biomass_products_to_transport_in_sankey), + Q(biomass_products_to_bunkers_in_sankey), + Q(biomass_products_to_export_in_sankey), + Q(biomass_products_to_other_in_sankey), + Q(biomass_products_to_energy_in_sankey), + Q(biomass_products_to_feedstock_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_coal_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_coal_input.gql new file mode 100644 index 0000000000..5aa1fa25df --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_coal_input.gql @@ -0,0 +1,17 @@ +- query = + SUM( + Q(sankey_final_demand_of_coal_and_derivatives_in_households_space_heating_and_hot_water_energetic), + Q(sankey_final_demand_of_coal_and_derivatives_in_households_other_energetic), + Q(sankey_final_demand_of_coal_and_derivatives_in_buildings_space_heating_energetic), + Q(sankey_final_demand_of_coal_and_derivatives_in_buildings_other_energetic), + Q(coal_and_derivatives_to_agriculture_in_sankey), + Q(sankey_final_demand_of_coal_and_derivatives_in_industry_other_energetic), + Q(sankey_final_demand_of_coal_and_derivatives_in_industry_ict_energetic), + Q(coal_and_derivatives_to_transport_in_sankey), + Q(coal_and_derivatives_to_bunkers_in_sankey), + Q(coal_and_derivatives_to_export_in_sankey), + Q(coal_and_derivatives_to_other_in_sankey), + Q(coal_and_derivatives_to_energy_in_sankey), + Q(coal_and_derivatives_to_feedstock_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_electricity_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_electricity_input.gql new file mode 100644 index 0000000000..0335f983aa --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_electricity_input.gql @@ -0,0 +1,18 @@ +- query = + SUM( + Q(sankey_final_demand_of_electricity_in_households_space_heating_and_hot_water_energetic), + Q(sankey_final_demand_of_electricity_in_households_other_energetic), + Q(sankey_final_demand_of_electricity_in_buildings_space_heating_energetic), + Q(sankey_final_demand_of_electricity_in_buildings_other_energetic), + Q(electricity_prod_to_agriculture_in_sankey), + Q(sankey_final_demand_of_electricity_in_industry_other_excl_p2h_energetic), + Q(sankey_final_demand_of_electricity_in_industry_ict_energetic), + Q(sankey_final_demand_of_electricity_in_industry_p2h_energetic), + Q(electricity_prod_to_transport_in_sankey), + Q(electricity_prod_to_bunkers_in_sankey), + Q(electricity_prod_to_export_in_sankey), + Q(electricity_prod_to_other_in_sankey), + Q(electricity_prod_to_energy_in_sankey), + Q(electricity_prod_to_feedstock_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_geothermal_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_geothermal_input.gql new file mode 100644 index 0000000000..189d4ac5d6 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_geothermal_input.gql @@ -0,0 +1,16 @@ +- query = + SUM( + Q(sankey_final_demand_of_geothermal_in_households_space_heating_and_hot_water_energetic), + Q(sankey_final_demand_of_geothermal_in_households_other_energetic), + Q(sankey_final_demand_of_geothermal_in_buildings_space_heating_energetic), + Q(sankey_final_demand_of_geothermal_in_buildings_other_energetic), + Q(final_demand_of_geothermal_in_agriculture_energetic), + Q(sankey_final_demand_of_geothermal_in_industry_other_energetic), + Q(sankey_final_demand_of_geothermal_in_industry_ict_energetic), + Q(final_demand_of_geothermal_in_transport_energetic), + Q(final_demand_of_geothermal_in_bunkers_energetic), + Q(final_demand_of_geothermal_in_other_energetic), + Q(final_demand_of_geothermal_in_energy_energetic), + Q(final_demand_of_geothermal_non_energetic) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_hydrogen_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_hydrogen_input.gql new file mode 100644 index 0000000000..489b683c3a --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_hydrogen_input.gql @@ -0,0 +1,17 @@ +- query = + SUM( + Q(sankey_final_demand_of_hydrogen_in_households_space_heating_and_hot_water_energetic), + Q(sankey_final_demand_of_hydrogen_in_households_other_energetic), + Q(sankey_final_demand_of_hydrogen_in_buildings_space_heating_energetic), + Q(sankey_final_demand_of_hydrogen_in_buildings_other_energetic), + Q(hydrogen_prod_to_agriculture_in_sankey), + Q(sankey_final_demand_of_hydrogen_in_industry_other_energetic), + Q(sankey_final_demand_of_hydrogen_in_industry_ict_energetic), + Q(hydrogen_prod_to_transport_in_sankey), + Q(hydrogen_prod_to_bunkers_in_sankey), + Q(hydrogen_prod_to_export_in_sankey), + Q(hydrogen_prod_to_other_in_sankey), + Q(hydrogen_prod_to_energy_in_sankey), + Q(hydrogen_prod_to_feedstock_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_liquid_hydrogen_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_liquid_hydrogen_input.gql new file mode 100644 index 0000000000..a6599615bc --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_liquid_hydrogen_input.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(imported_liquid_hydrogen_to_export_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_lohc_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_lohc_input.gql new file mode 100644 index 0000000000..1af5b97a7b --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_lohc_input.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(imported_lohc_to_export_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_natural_gas_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_natural_gas_input.gql new file mode 100644 index 0000000000..d8a85dfefe --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_natural_gas_input.gql @@ -0,0 +1,17 @@ +- query = + SUM( + Q(sankey_final_demand_of_natural_gas_in_households_space_heating_and_hot_water_energetic), + Q(sankey_final_demand_of_natural_gas_in_households_other_energetic), + Q(sankey_final_demand_of_natural_gas_in_buildings_space_heating_energetic), + Q(sankey_final_demand_of_natural_gas_in_buildings_other_energetic), + Q(natural_gas_to_agriculture_in_sankey), + Q(sankey_final_demand_of_natural_gas_in_industry_other_energetic), + Q(sankey_final_demand_of_natural_gas_in_industry_ict_energetic), + Q(natural_gas_to_transport_in_sankey), + Q(natural_gas_to_bunkers_in_sankey), + Q(natural_gas_to_export_in_sankey), + Q(natural_gas_to_other_in_sankey), + Q(natural_gas_to_energy_in_sankey), + Q(natural_gas_to_feedstock_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_oil_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_oil_input.gql new file mode 100644 index 0000000000..aba9705eee --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_oil_input.gql @@ -0,0 +1,17 @@ +- query = + SUM( + Q(sankey_final_demand_of_oil_and_derivatives_in_households_space_heating_and_hot_water_energetic), + Q(sankey_final_demand_of_oil_and_derivatives_in_households_other_energetic), + Q(sankey_final_demand_of_oil_and_derivatives_in_buildings_space_heating_energetic), + Q(sankey_final_demand_of_oil_and_derivatives_in_buildings_other_energetic), + Q(oil_and_derivatives_to_agriculture_in_sankey), + Q(sankey_final_demand_of_oil_and_derivatives_in_industry_other_energetic), + Q(sankey_final_demand_of_oil_and_derivatives_in_industry_ict_energetic), + Q(oil_and_derivatives_to_transport_in_sankey), + Q(oil_and_derivatives_to_bunkers_in_sankey), + Q(oil_and_derivatives_to_export_in_sankey), + Q(oil_and_derivatives_to_other_in_sankey), + Q(oil_and_derivatives_to_energy_in_sankey), + Q(oil_and_derivatives_to_feedstock_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_solar_thermal_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_solar_thermal_input.gql new file mode 100644 index 0000000000..4d5aee5fc2 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_solar_thermal_input.gql @@ -0,0 +1,16 @@ +- query = + SUM( + Q(sankey_final_demand_of_solar_in_households_space_heating_and_hot_water_energetic), + Q(sankey_final_demand_of_solar_in_households_other_energetic), + Q(sankey_final_demand_of_solar_in_buildings_space_heating_energetic), + Q(sankey_final_demand_of_solar_in_buildings_other_energetic), + Q(final_demand_of_solar_in_agriculture_energetic), + Q(sankey_final_demand_of_solar_in_industry_other_energetic), + Q(sankey_final_demand_of_solar_in_industry_ict_energetic), + Q(final_demand_of_solar_in_transport_energetic), + Q(final_demand_of_solar_in_bunkers_energetic), + Q(final_demand_of_solar_in_other_energetic), + Q(final_demand_of_solar_in_energy_energetic), + Q(final_demand_of_solar_non_energetic) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_steam_hot_water_input.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_steam_hot_water_input.gql new file mode 100644 index 0000000000..ad87b93e61 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_final_demand_steam_hot_water_input.gql @@ -0,0 +1,16 @@ +- query = + SUM( + Q(sankey_final_demand_of_heat_in_households_space_heating_and_hot_water_energetic), + Q(sankey_final_demand_of_heat_in_households_other_energetic), + Q(sankey_final_demand_of_heat_in_buildings_space_heating_energetic), + Q(sankey_final_demand_of_heat_in_buildings_other_energetic), + Q(final_demand_of_heat_in_agriculture_energetic), + Q(sankey_final_demand_of_heat_in_industry_other_energetic), + Q(sankey_final_demand_of_heat_in_industry_ict_energetic), + Q(final_demand_of_heat_in_transport_energetic), + Q(final_demand_of_heat_in_bunkers_energetic), + Q(final_demand_of_heat_in_other_energetic), + Q(final_demand_of_heat_in_energy_energetic), + Q(final_demand_of_heat_non_energetic) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_ammonia_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_ammonia_output.gql new file mode 100644 index 0000000000..386e41b467 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_ammonia_output.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(import_of_ammonia) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_biomass_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_biomass_output.gql new file mode 100644 index 0000000000..aabacc4fc1 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_biomass_output.gql @@ -0,0 +1,15 @@ +- query = + SUM( + Q(total_primary_demand_of_wood_pellets), + Q(total_primary_demand_of_torrefied_biomass_pellets), + Q(total_primary_demand_of_biogas), + Q(total_primary_demand_of_biodiesel), + Q(total_primary_demand_of_bio_ethanol), + Q(total_primary_demand_of_bio_kerosene), + Q(total_primary_demand_of_bio_lng), + Q(total_primary_demand_of_bio_oil), + Q(total_primary_demand_of_greengas), + Q(total_primary_demand_of_biogenic_waste), + Q(total_primary_demand_of_non_biogenic_waste) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_coal_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_coal_output.gql new file mode 100644 index 0000000000..94fdc32960 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_coal_output.gql @@ -0,0 +1,6 @@ +- query = + SUM( + Q(import_of_coal_and_derivatives), + Q(extraction_of_coal_and_derivatives) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_electricity_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_electricity_output.gql new file mode 100644 index 0000000000..c094003695 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_electricity_output.gql @@ -0,0 +1,11 @@ +- query = + SUM( + Q(total_primary_demand_of_solar_electricity), + Q(total_primary_demand_of_wind_offshore_electricity), + Q(total_primary_demand_of_wind_inland_electricity), + Q(total_primary_demand_of_wind_coastal_electricity), + Q(imported_electricity_to_electricity_prod_in_sankey), + Q(water_to_electricity_prod_in_sankey), + Q(geothermal_in_source_of_electricity_production) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_geothermal_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_geothermal_output.gql new file mode 100644 index 0000000000..e7c93d1573 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_geothermal_output.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(sankey_total_primary_demand_of_geothermal) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_hydrogen_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_hydrogen_output.gql new file mode 100644 index 0000000000..e6fef6578c --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_hydrogen_output.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(hydrogen_import_to_hydrogen_prod_in_sankey) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_liquid_hydrogen_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_liquid_hydrogen_output.gql new file mode 100644 index 0000000000..36baa83f25 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_liquid_hydrogen_output.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(import_of_liquid_hydrogen) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_lohc_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_lohc_output.gql new file mode 100644 index 0000000000..9ea1804c99 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_lohc_output.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(import_of_lohc) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_natural_gas_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_natural_gas_output.gql new file mode 100644 index 0000000000..f90b751758 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_natural_gas_output.gql @@ -0,0 +1,6 @@ +- query = + SUM( + Q(import_of_natural_gas_and_derivatives), + Q(extraction_of_natural_gas) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_oil_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_oil_output.gql new file mode 100644 index 0000000000..5e98f251d2 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_oil_output.gql @@ -0,0 +1,6 @@ +- query = + SUM( + Q(import_of_oil_and_derivatives), + Q(extraction_of_oil_and_derivatives) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_solar_thermal_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_solar_thermal_output.gql new file mode 100644 index 0000000000..4ceabdd564 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_solar_thermal_output.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(total_primary_demand_of_renewable_heat) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_steam_hot_water_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_steam_hot_water_output.gql new file mode 100644 index 0000000000..4557825ed0 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_steam_hot_water_output.gql @@ -0,0 +1,5 @@ +- query = + SUM( + Q(import_for_central_heat_conversion) + ) +- unit = PJ diff --git a/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_uranium_output.gql b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_uranium_output.gql new file mode 100644 index 0000000000..8c4e7ca602 --- /dev/null +++ b/gqueries/mechnical_turk/sankey/download/turk_sankey_primary_demand_uranium_output.gql @@ -0,0 +1,6 @@ +- query = + SUM( + Q(import_of_uranium), + Q(extraction_of_uranium) + ) +- unit = PJ diff --git a/graphs/energy/nodes/energy/energy_heat_backup_burner_mt_network_gas.ad b/graphs/energy/nodes/energy/energy_heat_backup_burner_mt_network_gas.ad index cb9f415a3d..d3712b0a54 100644 --- a/graphs/energy/nodes/energy/energy_heat_backup_burner_mt_network_gas.ad +++ b/graphs/energy/nodes/energy/energy_heat_backup_burner_mt_network_gas.ad @@ -1,5 +1,5 @@ - output.loss = elastic -- output.steam_hot_water = 1.03 +- output.steam_hot_water = 1.0 - groups = [heat_production, central_production, wacc_proven_tech, costs_production_heat_plants, sankey_conversion_group] - use = energetic - presentation_group = traditional_heat diff --git a/tasks/mt_sankey_csv_query_writer.rb b/tasks/mt_sankey_csv_query_writer.rb new file mode 100644 index 0000000000..31448643a7 --- /dev/null +++ b/tasks/mt_sankey_csv_query_writer.rb @@ -0,0 +1,51 @@ +require 'yaml' +require 'fileutils' + +def format_filename_part(text) + text.downcase.gsub(' ', '_') +end + +desc "Create Sankey files from a YAML configuration" +task :create_sankey_files do |t, args| + yaml_file = 'config/sankey_csv.yml' + base_path = 'gqueries/mechnical_turk/sankey/download' + + # Load YAML content from the file + data = YAML.load_file(yaml_file) + + # Check if the base directory exists, create if not + FileUtils.mkdir_p(base_path) + + grouped_data = Hash.new { |hash, key| hash[key] = [] } + + # Process each row in the YAML file + data['rows'].each do |row| + # Create a key based on Group, Carrier, and Type + key = [row['Group'], row['Carrier'], row['Type']] + grouped_data[key] << row['Value'] + end + + # Create files for each grouped key + grouped_data.each do |key, values| + formatted_group = format_filename_part(key[0]) + formatted_carrier = format_filename_part(key[1]) + formatted_type = format_filename_part(key[2]) + + file_name = "turk_sankey_#{formatted_group}_#{formatted_carrier}_#{formatted_type}.gql" + file_path = File.join(base_path, file_name) + + # Construct the query content with each value on a new line + query_values = values.map { |value| "Q(#{value})" }.join(",\n ") + file_content = <<-FILE_CONTENT +- query = + SUM( + #{query_values} + ) +- unit = PJ + FILE_CONTENT + + # Write the content to the file + File.open(file_path, 'w') { |file| file.write(file_content) } + puts "File created: #{file_path}" + end +end \ No newline at end of file