quintel / refinery

Calculates node demands and edge shares for sparse energy graphs.
2 stars 0 forks source link

Validation errors as result of input efficiencies in the metal sub-sector #54

Closed wouterterlouw closed 10 years ago

wouterterlouw commented 10 years ago

The metal producing converters in the consumption part of the Metal sub-sector use electricity and heat as input carriers. These converters are in fact pseudomixers. The related input efficiencies are either set in the .ad files or defined in refinery by the incoming energy flows. Currently, part of those efficiencies are set by energy flows (those who have an non-zero energy flow as result of the analysis assumptions), the remaining are set manually in the .ad files. This practice needs revision (see https://github.com/quintel/refinery/issues/43), because changes in the analysis assumptions result into errors, since energy flows that were non-zero initially, can become zero.

In the metal efficiencies branch on etsource I defined the input efficiencies for all converters. However, this results in validation errors:

Post-calculation validations failed with the following errors:

  * #<Refinery::Slot (out, useable_heat) node=:industry_aluminium_burner_network_gas> demand (1,372.5 PJ) does not match output of the node (1,372.5 PJ) (+0.003033 MJ)
  * #<Refinery::Slot (in, useable_heat) node=:industry_steel_electricfurnace_electricity> demand (617.501391 PJ) does not match demand from the node (617.501391 PJ) (-0.834189 KJ)

The validation errors are most likely result of setting efficiencies for the converters, combined met slightly different incoming energy flows defined by shares.

@antw Can you fix this and merge the branch?

Richard-Deuchler commented 10 years ago

Semaphore actually reports a couple more errors on this branch: (the first two being the same as above)


Failures:

  1) Calculating the ETSource datasets calculates the nl dataset
     Failure/Error: Atlas::Runner.new(dataset, @graph).calculate
     Refinery::FailedValidationError:
       Post-calculation validations failed with the following errors:

         * #<Refinery::Slot (out, useable_heat) node=:industry_aluminium_burner_network_gas> demand (1,372.5 PJ) does not match output of the node (1,372.5 PJ) (+0.003033 MJ)
         * #<Refinery::Slot (in, useable_heat) node=:industry_steel_electricfurnace_electricity> demand (617.501391 PJ) does not match demand from the node (617.501391 PJ) (-0.834189 KJ)
     # ./spec/calculate_spec.rb:14:in `block (3 levels) in <top (required)>'

  2) Calculating the ETSource datasets calculates the de dataset
     Failure/Error: Atlas::Runner.new(dataset, @graph).calculate
     Refinery::FailedValidationError:
       Post-calculation validations failed with the following errors: (the first two being the same as above)

         * #<Refinery::Slot (out, useable_heat) node=:industry_aluminium_burner_network_gas> demand (1,573.8 PJ) does not match output of the node (1,573.8 PJ) (+0.00742 MJ)
         * #<Refinery::Slot (in, useable_heat) node=:industry_aluminium_smeltoven_electricity> demand (314.76 PJ) does not match demand from the node (314.76 PJ) (-2.325237 KJ)
         * #<Refinery::Slot (out, useable_heat) node=:industry_steel_blastfurnace_burner_coal_gas> demand (138,067.303141 PJ) does not match output of the node (138,067.303141 PJ) (+0.282023 MJ)
         * #<Refinery::Slot (in, useable_heat) node=:industry_steel_electricfurnace_electricity> demand (25,625.106 PJ) does not match demand from the node (25,625.106 PJ) (-63.333782 KJ)
     # ./spec/calculate_spec.rb:14:in `block (3 levels) in <top (required)>'

  3) Calculating the ETSource datasets calculates the eu dataset
     Failure/Error: Atlas::Runner.new(dataset, @graph).calculate
     Refinery::FailedValidationError:
       Post-calculation validations failed with the following errors:

         * #<Refinery::Slot (out, useable_heat) node=:industry_aluminium_burner_network_gas> demand (14,635.240829 PJ) does not match output of the node (14,632.025703 PJ) (+3.215127 PJ)
         * #<Refinery::Slot (in, useable_heat) node=:industry_aluminium_smeltoven_electricity> demand (2,926.405141 PJ) does not match demand from the node (2,927.208922 PJ) (-803,781,690,224.859009 KJ)
         * #<Refinery::Slot (out, useable_heat) node=:industry_steel_blastfurnace_burner_coal_gas> demand (602,372.366068 PJ) does not match output of the node (602,341.028972 PJ) (+31.337096 PJ)
         * #<Refinery::Slot (in, useable_heat) node=:industry_steel_electricfurnace_electricity> demand (39,367.958946 PJ) does not match demand from the node (39,378.771955 PJ) (-10,813,008,815,650.96875 KJ)
     # ./spec/calculate_spec.rb:14:in `block (3 levels) in <top (required)>'
wouterterlouw commented 10 years ago

Ok, I think it should be something in the analysis. I will try to figure it out.

wouterterlouw commented 10 years ago

The large differences were due to a mistake in the analysis which will be updated soon. The validation errors for the smaller errors still occur. For the EU dataset:

➜  atlas git:(master) bundle exec rake debug DATASET=eu FAST=true
Debug output will be saved to tmp/debug-1383061413
INSUFFICIENT DATA FOR A MEANINGFUL ANSWER: |=====================================================================| 100%, Time: 00:00:10

Post-calculation validations failed with the following errors:

  * #<Refinery::Slot (out, useable_heat) node=:industry_aluminium_burner_network_gas> demand (14,640 PJ) does not match output of the node (14,640 PJ) (-15.642457 KJ)
  * #<Refinery::Slot (out, useable_heat) node=:industry_steel_electricfurnace_burner_network_gas> demand (39,389.414062 PJ) does not match output of the node (39,389.414062 PJ) (-45.297934 KJ)
wouterterlouw commented 10 years ago

I updated the metal efficiencies branch.

@antw Can fix the validation errors and merge the branch?

wouterterlouw commented 10 years ago

Thanks @antw