Skip to content

Add electric storage size class#564

Open
rathod-b wants to merge 19 commits into
developfrom
electric_storage_size_class
Open

Add electric storage size class#564
rathod-b wants to merge 19 commits into
developfrom
electric_storage_size_class

Conversation

@rathod-b
Copy link
Copy Markdown
Collaborator

No description provided.

Only adds size class in inputs processing, other code modifications pending.
Copy link
Copy Markdown
Collaborator

@Bill-Becker Bill-Becker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress. I left some comments and requests. Can you also check the results and proforma calcs to see if we need to update anything there? Please also add a test to validate that the size_class -> cost params are being properly assigned. Let's also work toward updating battery costs to the new ATB values (zero for constant, 4% O&M, scale 2025 values from 2023 dollars to 2025 dollars using CPI - I can show you what we did last year).

end

"""
get_pv_cost_params(; installed_cost_per_kw, size_class, tech_sizes_for_cost_curve,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update docstring for storage instead of pv

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still has "pv" and related argument names in it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

min_kw::Real = 0.0,
max_kw::Real = 1.0e9,
electric_load_annual_peak::Real = 0.0,
electric_load_average_peak::Real = 0.0
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove "_peak" assuming this is just the average load

{
"size_class": 1,
"name": "Residential",
"kw_tech_sizes_for_cost_curve": [0, 40],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's come up with a better name since we don't consider storage a "tech", and we're not doing a cost curve with this array for storage. How about "size_class_bounds"?

defaults[matching_default]
end

# STEP 2: Handle installed costs
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to remove/avoid all this validation and separate handling for scalar versus array cost parameters, since we're not allowing an array for storage.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I corrected those instances already.


@info s.installed_cost_per_kw, s.size_class, s.electric_load_annual_peak, s.electric_load_average_peak

installed_cost_per_kw, installed_cost_per_kwh, installed_cost_constant, size_class,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The O&M cost % is included in the defaults .json, implying that it changes by size_class, but we're not assigning it by size_class here. I'm fine to take it out of that file and just used a fixed default of 2.5% (will become 4% from the new ATB). ATB uses the same % for all three of their size_classes

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, since the degradation wear and tear will vary by cycling and not size class.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The (new) 2025 ATB has 4% as the O&M as a fraction of total installed cost, so we should update that as well (does not change with size class) from the current 2.5%. I will comment on the actual variable to change.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rathod-b Here's the link to the input (default value and in docstring) to be changed to 0.04, from 0.025:

om_cost_fraction_of_installed_cost::Float64 = 0.025 # Annual O&M cost as a fraction of installed cost

Comment thread src/core/scenario.jl Outdated
storage_dict["off_grid_flag"] = settings.off_grid_flag

electric_load_annual_peak = maximum(electric_load.loads_kw)
electric_load_average_peak = sum(electric_load.loads_kw) / Int(8760*settings.time_steps_per_hour)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to make sure it's converting to Int here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason for it, updated.

{
"size_class": 1,
"name": "Residential",
"size_class_kw_bounds": [0, 40],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nitpick, but I'd prefer to keep the units at the end, so size_class_bounds_kw.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

@rathod-b rathod-b marked this pull request as ready for review April 17, 2026 20:10
Update default costs to use 2025 costs converted to 2025$ instead of 2026 costs converted to 2025$. Also change size class names per feedback.
Copy link
Copy Markdown
Collaborator

@Bill-Becker Bill-Becker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to update OM to 4% from 2.5% per the new ATB - we'll also have to update this in the API.

end

# TODO combine functions to load size class defaults for eligible techs.
# Load PV default size class data from JSON file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on line 565 references "PV"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


@info s.installed_cost_per_kw, s.size_class, s.electric_load_annual_peak, s.electric_load_average_peak

installed_cost_per_kw, installed_cost_per_kwh, installed_cost_constant, size_class,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The (new) 2025 ATB has 4% as the O&M as a fraction of total installed cost, so we should update that as well (does not change with size class) from the current 2.5%. I will comment on the actual variable to change.


@info s.installed_cost_per_kw, s.size_class, s.electric_load_annual_peak, s.electric_load_average_peak

installed_cost_per_kw, installed_cost_per_kwh, installed_cost_constant, size_class,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rathod-b Here's the link to the input (default value and in docstring) to be changed to 0.04, from 0.025:

om_cost_fraction_of_installed_cost::Float64 = 0.025 # Annual O&M cost as a fraction of installed cost

@Bill-Becker
Copy link
Copy Markdown
Collaborator

@rathod-b I just merged develop into this branch and resolved the conflicts (not much), but I'll let you make the BESS O&M default cost update. There's one test that is explicitly checking for the 0.025, so we either need to hard-code that input or change the expected fraction to 0.04 in the test.

@Bill-Becker
Copy link
Copy Markdown
Collaborator

@rathod-b I just merged develop into this branch and resolved the conflicts (not much), but I'll let you make the BESS O&M default cost update. There's one test that is explicitly checking for the 0.025, so we either need to hard-code that input or change the expected fraction to 0.04 in the test.

Looks like merging develop broke the battery size class tests, and a couple others. let me know if you need any help debugging why.

@Bill-Becker
Copy link
Copy Markdown
Collaborator

@rathod-b Can you also implement this check on resulting battery size with respect to the size_class as we do for PV, so it throws a warning if the size is outside the size_class range?

if optimal_size < min_size || optimal_size > max_size

@Bill-Becker
Copy link
Copy Markdown
Collaborator

@rathod-b I just merged develop into this branch and resolved the conflicts (not much), but I'll let you make the BESS O&M default cost update. There's one test that is explicitly checking for the 0.025, so we either need to hard-code that input or change the expected fraction to 0.04 in the test.

I updated this.

@Bill-Becker
Copy link
Copy Markdown
Collaborator

@rathod-b Can you also implement this check on resulting battery size with respect to the size_class as we do for PV, so it throws a warning if the size is outside the size_class range?

if optimal_size < min_size || optimal_size > max_size

I implemented this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants