Skip to content

Commit 6badb4f

Browse files
committed
Address PR comments
1 parent 59b883d commit 6badb4f

2 files changed

Lines changed: 26 additions & 37 deletions

File tree

data/energy_storage/electric_storage/electric_storage_defaults.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"size_class": 1,
55
"name": "Residential",
6-
"size_class_kw_bounds": [0, 40],
6+
"size_class_bounds_kw": [0, 40],
77
"installed_cost_per_kw": 695,
88
"installed_cost_per_kwh": 580,
99
"installed_cost_constant": 0,
@@ -12,7 +12,7 @@
1212
{
1313
"size_class": 2,
1414
"name": "Small-Commercial",
15-
"size_class_kw_bounds": [40, 400],
15+
"size_class_bounds_kw": [40, 400],
1616
"installed_cost_per_kw": 667,
1717
"installed_cost_per_kwh": 527,
1818
"installed_cost_constant": 0,
@@ -21,7 +21,7 @@
2121
{
2222
"size_class": 3,
2323
"name": "Commercial",
24-
"size_class_kw_bounds": [400,1.0e6],
24+
"size_class_bounds_kw": [400,1.0e6],
2525
"installed_cost_per_kw": 520,
2626
"installed_cost_per_kwh": 262,
2727
"installed_cost_constant": 0,

src/core/energy_storage/electric_storage.jl

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -460,40 +460,29 @@ struct ElectricStorage <: AbstractElectricStorage
460460
end
461461

462462
"""
463-
get_pv_cost_params(; installed_cost_per_kw, size_class, tech_sizes_for_cost_curve,
464-
use_detailed_cost_curve, electric_load_annual_kwh, site_land_acres,
465-
site_roof_squarefeet, min_kw, max_kw, existing_kw, kw_per_square_foot,
466-
acres_per_kw, array_type, location)
463+
get_electric_storage_cost_params(; installed_cost_per_kw, installed_cost_per_kwh, installed_cost_constant,
464+
size_class, min_kw, max_kw, electric_load_annual_peak, electric_load_average)
467465
468-
Processes and determines the cost scaling parameters for a PV system, including installed cost per kW,
469-
O&M cost per kW, size class, and technology sizes for cost curves.
466+
Processes and determines the cost scaling parameters for a Battery system, including installed cost per kW,
467+
installed cost per kWh, installed cost constant and size class.
470468
471469
# Arguments
472-
- `installed_cost_per_kw::Union{Real, AbstractVector{<:Real}} = Float64[]`: User-provided installed cost per kW or cost curve.
473-
- `size_class::Union{Int, Nothing} = nothing`: User-specified size class or `nothing` to auto-determine.
474-
- `tech_sizes_for_cost_curve::AbstractVector = Float64[]`: Technology sizes for detailed cost curve.
475-
- `use_detailed_cost_curve::Bool = false`: Whether to use a detailed cost curve instead of average cost.
476-
- `electric_load_annual_kwh::Real = 0.0`: Annual electric load in kWh for size class determination.
477-
- `site_land_acres::Union{Real, Nothing} = nothing`: Available land area in acres for ground-mounted systems.
478-
- `site_roof_squarefeet::Union{Real, Nothing} = nothing`: Available roof area in square feet for rooftop systems.
479-
- `min_kw::Real = 0.0`: Minimum allowable system size in kW.
480-
- `max_kw::Real = 1.0e9`: Maximum allowable system size in kW.
481-
- `existing_kw::Real = 0.0`: Existing system size in kW.
482-
- `kw_per_square_foot::Real = 0.01`: Conversion factor for roof area to kW capacity.
483-
- `acres_per_kw::Real = 6e-3`: Conversion factor for land area to kW capacity.
484-
- `array_type::Int = 1`: PV array type (e.g., ground-mounted, rooftop).
485-
- `location::String = "both"`: Location type (`"roof"`, `"ground"`, or `"both"`).
486-
- `capacity_factor_estimate::Real = 0.2`: Estimated capacity factor for the PV system.
487-
- `fraction_of_annual_kwh_to_size_pv::Real = 0.5`: Fraction of annual kWh to size the PV system.
470+
- `installed_cost_per_kw`::Union{Real, Nothing} = Nothing,
471+
- `installed_cost_per_kwh`::Union{Real, Nothing} = Nothing,
472+
- `installed_cost_constant`::Union{Real, Nothing} = Nothing,
473+
- `size_class`::Union{Int, Nothing} = Nothing,
474+
- `min_kw`::Real = 0.0,
475+
- `max_kw`::Real = 1.0e9,
476+
- `electric_load_annual_peak`::Real = 0.0,
477+
- `electric_load_average`::Real = 0.0
488478
489479
# Returns
490-
A tuple containing:
491-
1. `installed_cost_per_kw`: Final installed cost per kW or cost curve.
492-
3. `size_class`: Determined size class.
493-
4. `size_class_kw_bounds`: Final technology sizes for the cost curve.
494-
5. `kwh_tech_sizes_for_cost_curve`: Final technology sizes for the cost curve.
495-
6. `size_kw_for_size_class`: Maximum kW for determining the size class.
496-
7. `size_kwh_for_size_class`: Maximum kW for determining the size class.
480+
Values:
481+
1. `installed_cost_per_kw`: Final installed cost per kW.
482+
2. `installed_cost_per_kwh`: Final installed cost per kWh.
483+
3. `installed_cost_constant`: Final installed cost constant.
484+
4. `size_class`: Determined size class.
485+
5. `size_kw_for_size_class`: Calculated size_kw used to determine size class.
497486
498487
# Notes
499488
- If `size_class` is not provided, it is determined based on (peak demand - average demand) or user-provided cost data.
@@ -535,7 +524,7 @@ function get_electric_storage_cost_params(;
535524
size_class
536525
else
537526
# Default case: no costs or size_class information provided.
538-
kw_tech_sizes = [c["size_class_kw_bounds"] for c in defaults]
527+
kw_tech_sizes = [c["size_class_bounds_kw"] for c in defaults]
539528
size_class, size_kw_for_size_class = get_electric_storage_size_class(
540529
electric_load_annual_peak,
541530
electric_load_average,
@@ -589,7 +578,7 @@ end
589578
function get_electric_storage_size_class(
590579
electric_load_annual_peak::Real,
591580
electric_load_average::Real,
592-
size_class_kw_bounds::AbstractVector;
581+
size_class_bounds_kw::AbstractVector;
593582
min_kw::Real=0.0,
594583
max_kw::Real=1.0e9
595584
)
@@ -613,7 +602,7 @@ function get_electric_storage_size_class(
613602
end
614603
@info size_kw
615604
# Find the appropriate kw size class for the effective size
616-
for (i, size_range) in enumerate(size_class_kw_bounds)
605+
for (i, size_range) in enumerate(size_class_bounds_kw)
617606
min_size = convert(Float64, size_range[1])
618607
max_size = convert(Float64, size_range[2])
619608

@@ -623,8 +612,8 @@ function get_electric_storage_size_class(
623612
end
624613
if isnothing(size_class_kw)
625614
# Handle edge cases -> highest size class returned.
626-
if size_kw > convert(Float64, size_class_kw_bounds[end][2])
627-
size_class_kw = length(size_class_kw_bounds)
615+
if size_kw > convert(Float64, size_class_bounds_kw[end][2])
616+
size_class_kw = length(size_class_bounds_kw)
628617
else
629618
size_class_kw = 1 # Default to smallest size class
630619
end

0 commit comments

Comments
 (0)