Buildings.Electrical.DC.Storage

Package with models for DC electrical storage

Information

This package contains models that represent different energy storages for DC power.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Buildings.Electrical.DC.Storage.Battery Battery Simple model of a battery
Buildings.Electrical.DC.Storage.Examples Examples Package with example models
Buildings.Electrical.DC.Storage.BaseClasses BaseClasses Base models for battery package

Buildings.Electrical.DC.Storage.Battery Buildings.Electrical.DC.Storage.Battery

Simple model of a battery

Buildings.Electrical.DC.Storage.Battery

Information

Simple model of a battery.

This model takes as an input the power that should be stored in the battery (if P > 0) or that should be extracted from the battery. The model uses a fictitious conductance (see Buildings.Electrical.DC.Loads.Conductor) G such that P = u   i and i = u   G, where u is the voltage difference across the pins and i is the current at the positive pin.

The output connector SOC is the state of charge of the battery. This model does not enforce that the state of charge is between zero and one. However, each time the state of charge crosses zero or one, a warning will be written to the simulation log file. The model also does not limit the current through the battery. The user should provide a control so that only a reasonable amount of power is exchanged, and that the state of charge remains between zero and one.

Parameters

TypeNameDefaultDescription
EfficiencyetaCha0.9Efficiency during charging [1]
EfficiencyetaDis0.9Efficiency during discharging [1]
RealSOC_start0.1Initial state of charge [1]
EnergyEMax Maximum available charge [J]
VoltageV_nominal Nominal voltage (V_nominal >= 0) [V]

Connectors

TypeNameDescription
input RealInputPPower stored in battery (if positive), or extracted from battery (if negative) [W]
output RealOutputSOCState of charge [1]
Terminal_pterminalGeneralized terminal

Modelica definition

model Battery "Simple model of a battery" parameter Modelica.SIunits.Efficiency etaCha(max=1) = 0.9 "Efficiency during charging"; parameter Modelica.SIunits.Efficiency etaDis(max=1) = 0.9 "Efficiency during discharging"; parameter Real SOC_start(min=0, max=1, unit="1")=0.1 "Initial state of charge"; parameter Modelica.SIunits.Energy EMax(min=0, displayUnit="kW.h") "Maximum available charge"; parameter Modelica.SIunits.Voltage V_nominal "Nominal voltage (V_nominal >= 0)"; Modelica.Blocks.Interfaces.RealInput P(unit="W") "Power stored in battery (if positive), or extracted from battery (if negative)"; Modelica.Blocks.Interfaces.RealOutput SOC(min=0, max=1, unit="1") "State of charge"; Buildings.Electrical.DC.Interfaces.Terminal_p terminal "Generalized terminal"; protected Buildings.Electrical.DC.Storage.BaseClasses.Charge cha( final EMax=EMax, final SOC_start=SOC_start, final etaCha=etaCha, final etaDis=etaDis) "Charge model"; Loads.Conductor bat( final mode=Buildings.Electrical.Types.Load.VariableZ_P_input, final V_nominal=V_nominal) "Power exchanged with battery pack"; Modelica.Blocks.Math.Gain gain(final k=-1); equation connect(cha.SOC, SOC); connect(cha.P, P); connect(bat.terminal, terminal); connect(P, gain.u); connect(gain.y, bat.Pow); end Battery;