Buildings.Electrical.AC.OnePhase.Storage

Package with models for electrical storage with a AC one phase connector

Information

This package contains models for storage elements with an AC one phase connector.

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

Package Content

Name Description
Buildings.Electrical.AC.OnePhase.Storage.Battery Battery Simple model of a battery
Buildings.Electrical.AC.OnePhase.Storage.Examples Examples Package with example models

Buildings.Electrical.AC.OnePhase.Storage.Battery Buildings.Electrical.AC.OnePhase.Storage.Battery

Simple model of a battery

Buildings.Electrical.AC.OnePhase.Storage.Battery

Information

Simple model of a battery.

This model takes as an input the power to be stored in the battery (if P > 0) or to be extracted from the battery. This model has a one phase AC connector and takes into account the efficiency of the conversion between DC and AC ηDCAC.

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.

Extends from Buildings.Electrical.Interfaces.PartialAcDcParameters (Partial model that contains basic parameters for a DC/AC conversion system).

Parameters

TypeNameDefaultDescription
replaceable package PhaseSystemBuildings.Electrical.PhaseSy...Phase system
EfficiencyetaCha0.9Efficiency during charging [1]
EfficiencyetaDis0.9Efficiency during discharging [1]
RealSOC_start Initial charge
EnergyEMax Maximum available charge [J]
VoltageV_nominal Nominal voltage (V_nominal >= 0) [V]
BooleanlinearizedfalseIf =true introduce a linearization in the load
Terminal_pterminalredeclare Buildings.Electric...Generalized terminal
AC-Conversion
Realpf0.9Power factor
Realeta_DCAC0.9Efficiency of DC/AC conversion
Initialization
InitModeinitModeBuildings.Electrical.Types.I...Initialization mode for homotopy operator

Connectors

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

Modelica definition

model Battery "Simple model of a battery" extends Buildings.Electrical.Interfaces.PartialAcDcParameters; replaceable package PhaseSystem = Buildings.Electrical.PhaseSystems.OnePhase constrainedby Buildings.Electrical.PhaseSystems.PartialPhaseSystem "Phase system"; 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(start=0.1) "Initial charge"; parameter Modelica.SIunits.Energy EMax(min=0, displayUnit="kWh") "Maximum available charge"; parameter Modelica.SIunits.Voltage V_nominal(start = 110) "Nominal voltage (V_nominal >= 0)"; parameter Boolean linearized=false "If =true introduce a linearization in the load"; parameter Buildings.Electrical.Types.InitMode initMode( min=Buildings.Electrical.Types.InitMode.zero_current, max=Buildings.Electrical.Types.InitMode.linearized) = Buildings.Electrical.Types.InitMode.zero_current "Initialization mode for homotopy operator"; Modelica.Blocks.Interfaces.RealInput P(unit="W") "Power stored in battery (if positive), or extracted from battery (if negative)"; Modelica.Blocks.Interfaces.RealOutput SOC "State of charge"; replaceable Buildings.Electrical.AC.OnePhase.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"; replaceable Buildings.Electrical.AC.OnePhase.Loads.Resistive bat constrainedby Buildings.Electrical.Interfaces.Load( final initMode = initMode, final mode=Buildings.Electrical.Types.Load.VariableZ_P_input, final V_nominal=V_nominal, final linearized=linearized) "Power exchanged with battery pack"; Modelica.Blocks.Math.Gain gain(final k=-1) "Gain that invert sign of the power (P<0 -> the load is consumed)"; Modelica.Blocks.Math.Gain acdc_con_dis(final k = 2 - eta_DCAC) "Losses when P < 0"; Buildings.Utilities.Math.Splice spl(deltax=1e-2) "Splice function that attributes the losses due to AC/DC conversion"; Modelica.Blocks.Math.Gain acdc_con_cha(final k=eta_DCAC) "Losses when P > 0"; equation connect(cha.SOC, SOC); connect(gain.y, bat.Pow); connect(bat.terminal, terminal); connect(P, acdc_con_dis.u); connect(P, acdc_con_cha.u); connect(acdc_con_cha.y, spl.u1); connect(acdc_con_dis.y, spl.u2); connect(P, spl.x); connect(spl.y, gain.u); connect(spl.y, cha.P); end Battery;