quintel / merit

A system for calculating hourly electricity and heat loads with a merit order
MIT License
3 stars 2 forks source link

full load hours of volatiles are wrong #34

Closed ChaelKruip closed 11 years ago

ChaelKruip commented 11 years ago

When using pry-remote with a 'binding.remote_pry' in between these lines, the merit order info table looks like this:

@m.info: 
+--------------------------------------------------------+-----------------------------+--------------------+--------------------+-----------------------+
| key                                                    | class                       | marginal costs     | full load hours    | production (PJ)       |
+--------------------------------------------------------+-----------------------------+--------------------+--------------------+-----------------------+
| buildings_solar_pv_solar_radiation                     | Merit::VolatileProducer     | 0.0                | 8584.799999998668  | 0.9801388799998477    |
| energy_power_solar_csp_solar_radiation                 | Merit::VolatileProducer     | 1.0                | 0.0                | 0.0                   |
| energy_power_solar_pv_solar_radiation                  | Merit::VolatileProducer     | 0.0                | 0.0                | 0.0                   |
| energy_power_wind_turbine_coastal                      | Merit::VolatileProducer     | 0.0                | 8322.0             | 5.991839999999999     |
| energy_power_wind_turbine_inland                       | Merit::VolatileProducer     | 0.0                | 8322.000000000024  | 32.35593599999999     |
| energy_power_wind_turbine_offshore                     | Merit::VolatileProducer     | 0.0                | 8059.1999999988975 | 5.636834742856381     |
| households_solar_pv_solar_radiation                    | Merit::VolatileProducer     | 0.0                | 8584.800000000983  | 1.9632211200002248    |
| agriculture_chp_engine_gas_power_fuelmix               | Merit::MustRunProducer      | 78.2912044043496   | 3980.42414355628   | 43.9200070553075      |
| buildings_collective_chp_gas_power_fuelmix             | Merit::MustRunProducer      | 94.00461948287406  | 3942.0             | 5.759999730892853     |
| buildings_collective_chp_wood_pellets                  | Merit::MustRunProducer      | 154.16507000812567 | 6097.77777777778   | 0.0                   |
| energy_power_geothermal                                | Merit::MustRunProducer      | 0.0                | 8250.0             | 0.0                   |
| energy_power_supercritical_waste_mix                   | Merit::MustRunProducer      | 1.2060890798839186 | 6190.47619047619   | 14.040003549310445    |
| energy_power_ultra_supercritical_cofiring_wood_pellets | Merit::MustRunProducer      | 76.54076672162961  | 6329.1             | 0.0                   |
| households_collective_chp_network_gas                  | Merit::MustRunProducer      | 85.59713754578537  | 3942.0             | 0.0                   |
| households_collective_chp_wood_pellets                 | Merit::MustRunProducer      | 119.97893462469432 | 6097.77777777778   | 0.0                   |
| households_space_heater_micro_chp_network_gas          | Merit::MustRunProducer      | NaN                | 0.0                | 0.0                   |
| households_water_heater_fuel_cell_chp_network_gas      | Merit::MustRunProducer      | NaN                | 0.0                | 0.0                   |
| households_water_heater_micro_chp_network_gas          | Merit::MustRunProducer      | NaN                | 0.0                | 0.0                   |
| industry_chp_combined_cycle_gas_power_fuelmix          | Merit::MustRunProducer      | 109.48622367590018 | 5442.83413848631   | 60.840015380343736    |
| industry_chp_supercritical_wood_pellets                | Merit::MustRunProducer      | 139.78983050846998 | 5247.81341107872   | 6.480001638143425     |
| industry_chp_ultra_supercritical_coal                  | Merit::MustRunProducer      | 32.155211147136    | 4204.8             | 0.0                   |
| other_chp_engine_gas_power_fuelmix                     | Merit::MustRunProducer      | 78.35349089083613  | 4000.0             | 0.0                   |
| energy_power_nuclear_gen3_uranium_oxide                | Merit::DispatchableProducer | 5.826162528219999  | 7884.000000000001  | 14.475024000000001    |
| energy_power_nuclear_gen2_uranium_oxide                | Merit::DispatchableProducer | 6.133182844247499  | 0.0                | 0.0                   |
| energy_power_ultra_supercritical_lignite               | Merit::DispatchableProducer | 13.999791000000002 | 0.0                | 0.0                   |
| energy_chp_ultra_supercritical_lignite                 | Merit::DispatchableProducer | 16.60280221570544  | 0.0                | 0.0                   |
| energy_power_ultra_supercritical_oxyfuel_ccs_lignite   | Merit::DispatchableProducer | 19.5875588852459   | 0.0                | 0.0                   |
| energy_power_combined_cycle_coal                       | Merit::DispatchableProducer | 23.206235140069815 | 7883.999999998865  | 7.1807471999989865    |
| energy_power_combined_cycle_ccs_coal                   | Merit::DispatchableProducer | 28.368603091935135 | 0.0                | 0.0                   |
| energy_power_ultra_supercritical_coal                  | Merit::DispatchableProducer | 28.88182917042096  | 7703.270989606596  | 74.49825668266205     |
| energy_power_supercritical_coal                        | Merit::DispatchableProducer | 29.9101120467295   | 0.0                | 0.0                   |
| energy_chp_ultra_supercritical_coal                    | Merit::DispatchableProducer | 32.392018334153555 | 7562.661521001719  | 45.466243477619265    |
| energy_power_ultra_supercritical_ccs_coal              | Merit::DispatchableProducer | 34.97149517639419  | 0.0                | 0.0                   |
| energy_power_combined_cycle_gas_power_fuelmix          | Merit::DispatchableProducer | 44.22593220218116  | 5268.837140035736  | 75.90919044392285     |
| energy_power_combined_cycle_ccs_gas_power_fuelmix      | Merit::DispatchableProducer | 57.26112857757725  | 0.0                | 0.0                   |
| energy_chp_combined_cycle_gas_power_fuelmix            | Merit::DispatchableProducer | 60.30808936661068  | 1625.7070841086925 | 19.3461744140269      |
| energy_power_ultra_supercritical_gas_power_fuelmix     | Merit::DispatchableProducer | 65.87652585429215  | 225.22181206417207 | 3.1004935536002223    |
| energy_power_turbine_network_gas                       | Merit::DispatchableProducer | 77.98197269622605  | 2.9405857154323356 | 0.0022442550180179596 |
| energy_power_ultra_supercritical_crude_oil             | Merit::DispatchableProducer | 93.09320787177599  | 0.0                | 0.0                   |
| energy_power_engine_diesel                             | Merit::DispatchableProducer | 93.09320787177599  | 0.0                | 0.0                   |
| energy_chp_ultra_supercritical_crude_oil               | Merit::DispatchableProducer | 109.37827642710315 | 0.0                | 0.0                   |
| energy_chp_ultra_supercritical_wood_pellets            | Merit::DispatchableProducer | 139.78983050846998 | 0.0                | 0.0                   |
| TOTALS:                                                |                             |                    |                    | 417.9463721237027     |
+--------------------------------------------------------+-----------------------------+--------------------+--------------------+-----------------------+

Curiously, the full_load_hours (and, therefore, productions) of wind turbines are much higher than they should be. The the full_load_hours are input to the MO module, and should be constant regardless.

This could very well be the reason for the discrepancy of production and demand when injecting the MO the full_load_hours into the ETM:

NOTE: the the full_load_hours in the table are correct again! They also look to be correct when using a stub with the MO module to reproduce the exact scenario. Only when printing the values inside the 'pry' session, do these weird values show up...

dennisquintel commented 11 years ago

Opening up that pry-debugger, and looking up inland = @m.participant(:energy_power_wind_turbine_inland) tells:

inland.full_load_hours
=> 8322.00

But apparently, the full load hours where never inputted for this participant:

inland.instance_variable_get(:@full_load_hours)
=> nil

So, because it hasn't been input, Merit calculates the full_load_hours by the following rule:

production / (effective_output_capacity * number_of_units * 3600)

Which evaluates to something close to 8760 hours.

dennisquintel commented 11 years ago

I think there is a typo here:

if type == :must_run || type == :volatile_producers
  attrs[:load_profile_key] = c.load_profile_key
  attrs[:full_load_hours]  = c.full_load_hours
end

The :type here is volatile_producers, but shouldn't that be :volatile, like defined on this line?

dennisquintel commented 11 years ago

Fixed with quintel/etengine@e85f8a5

ChaelKruip commented 11 years ago

Well spotted! Kudos!