Skip to content

Commit

Permalink
Merge pull request #238 from NREL/gen-defaults
Browse files Browse the repository at this point in the history
Generator installed_cost_per_kw default
  • Loading branch information
hdunham authored Jul 26, 2023
2 parents 92cc104 + 9c232e0 commit 912cd69
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Classify the change according to the following categories:
## Develop
### Changed
- Changed unit test expected values due to update to PVWatts v8, which slightly changed expected PV production factors.
- Changed **fuel_avail_gal** default to 1e9 for on-grid scenarios (same as off-grid)
### Fixed
- Corrected `Generator` **installed_cost_per_kw** from 500 to 650 if **only_runs_during_grid_outage** is _true_ or 800 if _false_

## v0.32.4
### Changed
- Consolidated PVWatts API calls to 1 call (previously 3 separate calls existed). API call occurs in `src/core/utils.jl/call_pvwatts_api()`. This function is called for PV in `src/core/production_factor.jl/get_production_factor(PV)` and for GHP in `src/core/scenario.jl`. If GHP and PV are evaluated together, the GHP PVWatts call for ambient temperature is also used to assign the pv.production_factor_series in Scenario.jl so that the PVWatts API does not get called again downstream in `get_production_factor(PV)`.
Expand Down
12 changes: 6 additions & 6 deletions src/core/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
"""
`Generator` is an optional REopt input with the following keys and default values:
```julia
only_runs_during_grid_outage::Bool = true,
existing_kw::Real = 0,
min_kw::Real = 0,
max_kw::Real = 1.0e6,
installed_cost_per_kw::Real = 500.0,
installed_cost_per_kw::Real = only_runs_during_grid_outage ? 650.0 : 800.0,
om_cost_per_kw::Real = off_grid_flag ? 20.0 : 10.0,
om_cost_per_kwh::Real = 0.0,
fuel_cost_per_gallon::Real = 3.0,
electric_efficiency_full_load::Real = 0.3233,
electric_efficiency_half_load::Real = electric_efficiency_full_load,
fuel_avail_gal::Real = off_grid_flag ? 1.0e9 : 660.0,
fuel_avail_gal::Real = 1.0e9,
fuel_higher_heating_value_kwh_per_gal::Real = 40.7,
min_turn_down_fraction::Real = off_grid_flag ? 0.15 : 0.0,
only_runs_during_grid_outage::Bool = true,
sells_energy_back_to_grid::Bool = false,
can_net_meter::Bool = false,
can_wholesale::Bool = false,
Expand Down Expand Up @@ -125,19 +125,19 @@ struct Generator <: AbstractGenerator
function Generator(;
off_grid_flag::Bool = false,
analysis_years::Int = 25,
only_runs_during_grid_outage::Bool = true,
existing_kw::Real = 0,
min_kw::Real = 0,
max_kw::Real = 1.0e6,
installed_cost_per_kw::Real = 500.0,
installed_cost_per_kw::Real = only_runs_during_grid_outage ? 650.0 : 800.0,
om_cost_per_kw::Real= off_grid_flag ? 20.0 : 10.0,
om_cost_per_kwh::Real = 0.0,
fuel_cost_per_gallon::Real = 3.0,
electric_efficiency_full_load::Real = 0.3233,
electric_efficiency_half_load::Real = electric_efficiency_full_load,
fuel_avail_gal::Real = off_grid_flag ? 1.0e9 : 660.0,
fuel_avail_gal::Real = 1.0e9,
fuel_higher_heating_value_kwh_per_gal::Real = KWH_PER_GAL_DIESEL,
min_turn_down_fraction::Real = off_grid_flag ? 0.15 : 0.0,
only_runs_during_grid_outage::Bool = true,
sells_energy_back_to_grid::Bool = false,
can_net_meter::Bool = false,
can_wholesale::Bool = false,
Expand Down
4 changes: 2 additions & 2 deletions src/mpc/structs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function MPCGenerator(;
fuel_cost_per_gallon::Real = 3.0,
electric_efficiency_full_load::Real = 0.3233,
electric_efficiency_half_load::Real = electric_efficiency_full_load,
fuel_avail_gal::Real = 660.0,
fuel_avail_gal::Real = 1.0e9,
fuel_higher_heating_value_kwh_per_gal::Real = KWH_PER_GAL_DIESEL,
min_turn_down_fraction::Real = 0.0, # TODO change this to non-zero value
only_runs_during_grid_outage::Bool = true,
Expand All @@ -310,7 +310,7 @@ struct MPCGenerator <: AbstractGenerator
fuel_cost_per_gallon::Real = 3.0,
electric_efficiency_full_load::Real = 0.3233,
electric_efficiency_half_load::Real = electric_efficiency_full_load,
fuel_avail_gal::Real = 660.0,
fuel_avail_gal::Real = 1.0e9,
fuel_higher_heating_value_kwh_per_gal::Real = KWH_PER_GAL_DIESEL,
min_turn_down_fraction::Real = 0.0, # TODO change this to non-zero value
only_runs_during_grid_outage::Bool = true,
Expand Down
2 changes: 2 additions & 0 deletions test/scenarios/backup_reliability_reopt_inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"federal_rebate_per_kw": 350.0
},
"Generator": {
"installed_cost_per_kw": 500.0,
"fuel_avail_gal": 660,
"min_kw": 200,
"max_kw": 200
},
Expand Down
1 change: 1 addition & 0 deletions test/scenarios/emissions.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"outage_durations": [10]
},
"Generator": {
"installed_cost_per_kw": 500.0,
"max_kw": 500.0,
"fuel_avail_gal": 125.0,
"min_turn_down_fraction": 0.0,
Expand Down
1 change: 1 addition & 0 deletions test/scenarios/generator.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"outage_end_time_step": 12
},
"Generator": {
"installed_cost_per_kw": 500.0,
"max_kw": 500.0,
"fuel_avail_gal": 125.0,
"min_turn_down_fraction": 0.0,
Expand Down
1 change: 1 addition & 0 deletions test/scenarios/mpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05]
},
"Generator": {
"fuel_avail_gal": 660,
"size_kw": 30,
"only_runs_during_grid_outage": false
},
Expand Down
2 changes: 2 additions & 0 deletions test/scenarios/nogridcost_minresilhours.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
"critical_load_fraction": 1
},
"Generator": {
"fuel_avail_gal": 660,
"installed_cost_per_kw": 500.0
},
"Financial": {
"value_of_lost_load_per_kwh": 0.001,
Expand Down
2 changes: 2 additions & 0 deletions test/scenarios/nogridcost_multiscenario.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
"critical_load_fraction": 0.1
},
"Generator": {
"fuel_avail_gal": 660,
"installed_cost_per_kw": 500.0,
"max_kw": 0.0
},
"Financial": {
Expand Down
2 changes: 2 additions & 0 deletions test/scenarios/outage.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"outage_durations": [10]
},
"Generator": {
"fuel_avail_gal": 660,
"installed_cost_per_kw": 500.0,
"existing_kw": 0.0,
"min_turn_down_fraction": 0.0,
"only_runs_during_grid_outage": true,
Expand Down

0 comments on commit 912cd69

Please sign in to comment.