Development: possibility of defining electric storages

Hi @chris @MingboPeng

I hope you are pretty well.

I am reaching out to discuss the potential development of a dedicated electric storage component (e.g., for battery systems) within the Ladybug Tools ecosystem, additionally for use with Dragonfly and URBANopt. Such a component would significantly enhance the ability to model and harness energy flexibility at both building and community scales, especially in the context of renewable energy integration and urban energy planning.

To support energy flexibility and align with the capabilities of EnergyPlus (which underpins much of URBANopt’s energy modeling), I suggest the following features for the electric storage component:

  1. Battery Storage Model:
  • Support for both simple and kinetic battery models (similar to EnergyPlus’s ElectricLoadCenter:Storage:Simple and ElectricLoadCenter:Storage:Battery objects).
  • Parameters for:
    • Nominal capacity (kWh).
    • Maximum charge/discharge rates (kW).
    • Round-trip efficiency (%).
    • State of charge (SOC) constraints (minimum and maximum SOC).
    • Thermal losses impacting zone heat gains (if located in a conditioned space).
  • Option to specify battery type (e.g., lithium-ion, lead-acid) for more detailed kinetic modeling.
  1. Flexible Scheduling:
  • Input for charge/discharge schedules to control when the battery stores or releases energy. For example:
    • Charge during off-peak hours or when renewable generation exceeds demand.
    • Discharge during peak electricity price periods or high-demand hours.
  • Support for schedule inputs compatible with Ladybug Tools’ data collections (e.g., hourly or sub-hourly schedules).
  1. Power Input and Output Control:
  • Ability to define specific power inputs (e.g., from PV arrays, wind turbines, or backup generators like diesel engines (wind turbines and diesels are not still developed in LB, what it is possible for this maybe something like spreadsheet input at the moment)).
  • Support for scenarios where power generation exceeds demand (e.g., diesel generators producing surplus power during outages), allowing excess energy to be stored rather than wasted.
  • Integration with Electric Load Center logic (inspired by EnergyPlus) to manage power flows between generators, storage, and building/community loads.
  1. Community-Scale Integration:
  • Compatibility with Dragonfly for modeling district-scale energy systems, enabling batteries to be shared across multiple buildings or centralized at the community level.
  • Integration with URBANopt to optimize storage operation within district energy systems, considering:
    • Aggregated load profiles across buildings.
    • Time-of-use (TOU) electricity tariffs and demand charges.
    • Renewable energy forecasting and grid interaction (e.g., net metering, grid export limits).
  • Support for modeling microgrids or virtual power plants, where storage plays a key role in balancing supply and demand.
  1. Interoperability with Other Systems:
  • Ability to connect storage to renewable energy components (e.g., PV arrays modeled in Ladybug) and backup generators (e.g., diesel or natural gas engines).
  • Support for AC/DC power flows, including inverter efficiencies (e.g., using EnergyPlus’s ElectricLoadCenter:Inverter and ElectricLoadCenter:Storage:Converter objects as a reference).
  • Option to model storage as part of a hybrid energy system, combining renewables, storage, and grid power.

I found the attached OSM examples, maybe helpful. The main drawbacks of this kind of equipment in the OpenStudio is the lack of visual representation of the equipment, such as batteries.
pv_and_storage_facilityexcess.osm (322.7 KB)
storage_liion_battery.osm (79.1 KB)

Thank you very much for your support and assistance.

Sincerely
Behnam
NUI Maynooth, Ireland

2 Likes

Hi @behnammmohseni thanks for your detailed feature request and sample osm files. I will review it this weekend and keep you posted.

2 Likes

An update, I have not forgotten about this. I have checked your sample files and E+/OpenStudio documents, it is possible to support ElectricLoadCenter and its sub-objects in Ironbug. I will keep you updated.

2 Likes

Hi @MingboPeng
I hope you are pretty well
Fantastic, thanks very much for your update. Looking forward to hearing from you.
Thanks very much for your time and assistance

Hi @MingboPeng @chris

I hope you are pretty well

Sorry I forgot one important thing, to have that kind of selling/buying for the energy flexibility scenarios with on-site generation, ElectricLoadCenter:Transformer‎ should be in the simulation (Fig 1.206 from EnergyPlus InputOutputReference):

Below is an example of OSM for the transformer:

transformer.osm (318.4 KB)

The OSM model I previously attached ( pv_and_storage_facilityexcess.osm) has the process of selling to the grid but without integration of transformer, most probably EnergyPlus uses some kind of simple equation or empirical for the power flow, …

But in real case, it should be ElectricLoadCenter:Transformer‎ to perfectly manage the task.

As an example those excess with PV that EnergyPlus has are in a single phase, which if you want to go for three phases, it cannot handle and you need the transformer.

@MingboPeng I would appreciate it if you could kindly develop thess transformers in IronBug.

I have found one good example in the EnergyPlus GitHub repo, it is in IDF and it has several things like: Diesel Generators, Gas Turbine Generators, Microturbine Generators with Transformer in 3 Phase. I run the IDF in LadyBug and it works and simulates without a problem. The challenge here is that LadyBug does not produce the OSM file using the HB Run IDF, so I use OpenStudio Application to import the IDF, run and save the OSM file (@chris another development here could be to enable OSM output for the HB Run IDF). Please find the attached IDF and the OSM for this Generators_Transformer.

Generators_Transformer.idf (122.8 KB)
Generators_Transformer_OSM.osm (108.4 KB)

The above simulations does not have batteries but the below OSMs have batteries (simple and NMC LiIon):

pv_and_storage_facilityexcess.osm (322.7 KB)
storage_liion_battery.osm (79.1 KB)

Developing the mentioned items in the OSM files in IB and HB will help a lot to perform such kind of energy management and energy flexibility.

Thank you very much in advance for your time and assistance.

Sincerely,
Behnam Mohseni Gharyehsafa
Maynooth, Ireland

Hi @behnammmohseni

I finally have time to work on this. Here are the new components that have been added to Ironbug and you can use for ElectricalLoadCenter related simulation.

image

I have also included sample files in which I tried to recreate from the EnergyPlus sample files. Please note that not all of the inputs for the components are the same as in the E+ sample, but these template files should provide you with enough information to get started.

Each template file provides a complete end-to-end example, including a test building and PV surfaces. Please adjust it to suit your own project.

image

You can download the latest Ironbug installer to test before the new Pollination installer.
Releases · MingboPeng/Ironbug

5 Likes

Hi @MingboPeng

Wonderful:)

This is such a fantastic news, thanks very much for your effort and time.

Sincerely,
Behnam

Hi @MingboPeng

I hope you are pretty well.

Sorry, I faced two challenges when working with the developed Electric Load Center component.

  1. When you have a simulation using HB, and you are interested in adding the PV shades and batteries, you will get the following error:

  1. When I wanted to add storage (with an associated converter and NMC battery), I was not able to find out how to properly define the charging/discharging schedules for the load center.

Manually, I added the proper information in the produced IDF and ran the IDF, and the system is working.

I was wondering whether it is possible to you could show how the information can be added to the Grasshopper environment. Kindly find the edited IDF below and the main simulations that the base IDF is produced from.

I used the below extra IDF to have the battery and other necessary items:

ElectricLoadCenter:Distribution,
Electric Load Center Distribution 1, !- Name
Electric Load Center Distribution 1 Generators, !- Generator List Name
Baseload, !- Generator Operation Scheme Type
0, !- Generator Demand Limit Scheme Purchased Electric Demand Limit {W}
, !- Generator Track Schedule Name Scheme Schedule Name
, !- Generator Track Meter Scheme Meter Name
DirectCurrentWithInverterDCStorage, !- Electrical Buss Type
Electric Load Center Inverter PVWatts 1, !- Inverter Name
NMC_Battery, !- Electrical Storage Object Name
, !- Transformer Object Name
TrackChargeDischargeSchedules, !- Storage Operation Scheme
, !- Storage Control Track Meter Name
Converter 1, !- Storage Converter Object Name
0.96, !- Maximum Storage State of Charge Fraction
0.04, !- Minimum Storage State of Charge Fraction
5000, !- Design Storage Control Charge Power {W}
Charge Schedule, !- Storage Charge Power Fraction Schedule Name
5000, !- Design Storage Control Discharge Power {W}
Discharge Schedule, !- Storage Discharge Power Fraction Schedule Name
, !- Storage Control Utility Demand Target {W}
; !- Storage Control Utility Demand Target Fraction Schedule Name

Schedule:Compact,
ALWAYS_ON, !- Name
On/Off, !- Schedule Type Limits Name
Through: 12/31, !- Field 1
For: AllDays, !- Field 2
Until: 24:00,1; !- Field 3

ElectricLoadCenter:Storage:Converter,
Converter 1, !- Name
ALWAYS_ON, !- Availability Schedule Name
SimpleFixed, !- Power Conversion Efficiency Method
0.95, !- Simple Fixed Efficiency
, !- Design Maximum Continuous Input Power {W}
, !- Efficiency Function of Power Curve Name
20, !- Ancillary Power Consumed In Standby {W}
, !- Zone Name
0.25; !- Radiative Fraction

ElectricLoadCenter:Storage:LiIonNMCBattery,
NMC_Battery, !- Name
ALWAYS_ON, !- Availability Schedule Name
, !- Zone Name
0.0, !- Radiative Fraction
KandlerSmith, !- Lifetime Model
13, !- Number of Cells in Series
80, !- Number of Strings in Parallel
0.7, !- Initial Fractional State of Charge
, !- DC to DC Charging Efficiency
80, !- Battery Mass {kg}
10, !- Battery Surface Area {m2}
0.95, !- Maximum Storage State of Charge Fraction
0.20; !- Minimum Storage State of Charge Fraction

ElectricLoadCenter:Inverter:LookUpTable,
Electric Load Center Inverter PVWatts 1, !- Name
ALWAYS_ON, !- Availability Schedule Name
, !- Zone Name
0.25, !- Radiative Fraction
14000, !- Rated Maximum Continuous Output Power {W}
200.0, !- Night Tare Loss Power {W}
368, !- Nominal Voltage Input {V}
0.839, !- Efficiency at 10% Power and Nominal Voltage
0.897, !- Efficiency at 20% Power and Nominal Voltage
0.916, !- Efficiency at 30% Power and Nominal Voltage
0.931, !- Efficiency at 50% Power and Nominal Voltage
0.934, !- Efficiency at 75% Power and Nominal Voltage
0.930; !- Efficiency at 100% Power and Nominal Voltage

ScheduleTypeLimits,
Fraction, !- Name
0.0, !- Lower Limit Value
1.0, !- Upper Limit Value
CONTINUOUS; !- Numeric Type

Schedule:Compact,
Charge Schedule, !- Name
Fraction, !- Schedule Type Limits Name
Through: 12/31, !- Field 1
For: AllDays, !- Field 2
Until: 10:00,0.0, !- Field 3
Until: 14:00,1.0, !- Field 5
Until: 24:00,0.0; !- Field 5

Schedule:Compact,
Discharge Schedule, !- Name
Fraction, !- Schedule Type Limits Name
Through: 12/31, !- Field 1
For: AllDays, !- Field 2
Until: 17:00,0.0, !- Field 3
Until: 24:00,1.0; !- Field 5

added_battery.idf (213.5 KB)

based_IDF.gh (79.6 KB)

I would appreciate it if you could kindly address the first and the second challenge, where the HB style of the HVAC can also be interpretable for the IB_SaveToFile and formulation of the battery with associated schedules.

Thanks very much, and I look forward to hearing from you.

Sincerely,
Behnam