Class BatteryStorage

All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, SimulationInterface, NamedInterface

public class BatteryStorage extends ProcessEquipmentBaseClass
Simple battery storage unit maintaining a state of charge.

The unit can be charged or discharged by supplying a power level and a duration. The state of charge is updated accordingly and the energy stream of the unit reflects the power usage (positive duty while charging and negative when discharging).

Author:
esol
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • capacity

      private double capacity
    • stateOfCharge

      private double stateOfCharge
    • chargeEfficiency

      private double chargeEfficiency
    • dischargeEfficiency

      private double dischargeEfficiency
    • currentPower

      private double currentPower
  • Constructor Details

    • BatteryStorage

      public BatteryStorage(String name, double capacity)
      Construct a battery with the given name and capacity.
      Parameters:
      name - name of the unit
      capacity - maximum energy capacity [J]
    • BatteryStorage

      public BatteryStorage()
      Default constructor with zero capacity.
    • BatteryStorage

      public BatteryStorage(String name)
      Construct a battery with a given name and zero capacity.
      Parameters:
      name - name of the unit
  • Method Details

    • charge

      public void charge(double power, double hours)
      Charge the battery.
      Parameters:
      power - charging power [W]
      hours - duration of charging [h]
    • discharge

      public double discharge(double power, double hours)
      Discharge the battery.
      Parameters:
      power - requested power [W]
      hours - duration of discharge [h]
      Returns:
      actual delivered power [W]
    • getStateOfCharge

      public double getStateOfCharge()
      Get state of charge [J].
      Returns:
      current stored energy
    • setStateOfCharge

      public void setStateOfCharge(double soc)
      Set state of charge [J].
      Parameters:
      soc - stored energy
    • getCapacity

      public double getCapacity()
      Get capacity [J].
      Returns:
      maximum storage capacity
    • setCapacity

      public void setCapacity(double capacity)
      Set capacity [J].
      Parameters:
      capacity - maximum storage capacity
    • getStateOfChargeFraction

      public double getStateOfChargeFraction()
      Get state of charge as a fraction of capacity.
      Returns:
      state of charge [0-1]
    • run

      public void run(UUID id)

      In this method all thermodynamic and unit operations will be calculated in a steady state calculation.

      Parameters:
      id - UUID