LBL logo

Buildings.Electrical.AC.OnePhase.Lines

Package with models for AC electrical lines

Information

This package contains models for transmission lines and electrical networks.

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

Package Content

Name Description
Buildings.Electrical.AC.OnePhase.Lines.Line Line Model of an electrical line
Buildings.Electrical.AC.OnePhase.Lines.Network Network Single phase AC network
Buildings.Electrical.AC.OnePhase.Lines.TwoPortInductance TwoPortInductance Model of an inductive element with two electrical ports
Buildings.Electrical.AC.OnePhase.Lines.TwoPortRL TwoPortRL Model of a resistive-inductive element with two electrical ports
Buildings.Electrical.AC.OnePhase.Lines.TwoPortRLC TwoPortRLC Model of an RLC element with two electrical ports
Buildings.Electrical.AC.OnePhase.Lines.TwoPortResistance TwoPortResistance Model of a resistance with two electrical ports
Buildings.Electrical.AC.OnePhase.Lines.Examples Examples Package with example models

Buildings.Electrical.AC.OnePhase.Lines.Line Buildings.Electrical.AC.OnePhase.Lines.Line

Model of an electrical line

Buildings.Electrical.AC.OnePhase.Lines.Line

Information

This model represents an AC single phase cable. The model is based on Buildings.Electrical.AC.OnePhase.Lines.TwoPortRLC and provides functionalities to parametrize the values of R, L and C, either using commercial cables or using default values.

Extends from Buildings.Electrical.Transmission.BaseClasses.PartialLine (Partial cable line dispersion model).

Parameters

TypeNameDefaultDescription
replaceable package PhaseSystem_pPartialPhaseSystemPhase system of terminal p
replaceable package PhaseSystem_nPartialPhaseSystemPhase system of terminal n
Lengthl Length of the line [m]
PowerP_nominal Nominal power of the line [W]
Model
Assumptions
Booleanuse_CfalseSet to true to add a capacitance in the center of the line
LoadmodelModeBuildings.Electrical.Types.L...Select between steady state and dynamic model
Thermal
Booleanuse_TfalseIf true, enables the input for the temperature of the cable
TemperatureTCableT_refFixed temperature of the cable [K]
Tech. specification
Auto/Manual mode
CableModemodeBuildings.Electrical.Types.C...Select if choosing the cable automatically or between a list of commercial options
Manual mode
GenericcommercialCableBuildings.Electrical.Transmi...Commercial cables options

Connectors

TypeNameDescription
replaceable package PhaseSystem_pPhase system of terminal p
replaceable package PhaseSystem_nPhase system of terminal n
input RealInputTTemperature of the cable

Modelica definition

model Line "Model of an electrical line" extends Buildings.Electrical.Transmission.BaseClasses.PartialLine( V_nominal(start = 110), redeclare package PhaseSystem_p = PhaseSystems.OnePhase, redeclare package PhaseSystem_n = PhaseSystems.OnePhase, redeclare Interfaces.Terminal_n terminal_n, redeclare Interfaces.Terminal_p terminal_p, commercialCable = Buildings.Electrical.Transmission.Functions.selectCable_low(P_nominal, V_nominal)); protected replaceable TwoPortRL line(R=R/3,L=L/3) constrainedby Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortRLC( useHeatPort=true, mode=modelMode, M=M, T_ref=T_ref) "Model of the line"; equation connect(cableTemp.port, line.heatPort); connect(line.terminal_n, terminal_n); connect(terminal_p, line.terminal_p); end Line;

Buildings.Electrical.AC.OnePhase.Lines.Network Buildings.Electrical.AC.OnePhase.Lines.Network

Single phase AC network

Buildings.Electrical.AC.OnePhase.Lines.Network

Information

This model represents a generalized electrical AC single phase network.

See Buildings.Electrical.Transmission.BaseClasses.PartialNetwork for information about the network model.

See Buildings.Electrical.Transmission.Grids.PartialGrid for more information about the topology of the network, such as the number of nodes, how they are connected, and the length of each connection.

Extends from Buildings.Electrical.Transmission.BaseClasses.PartialNetwork (Partial model that represent an electric network).

Parameters

TypeNameDefaultDescription
Model
Assumptions
Booleanuse_CfalseIf true, model the cable capacity
LoadmodelModeTypes.Load.FixedZ_steady_stateSelect between steady state and dynamic model

Modelica definition

model Network "Single phase AC network" extends Buildings.Electrical.Transmission.BaseClasses.PartialNetwork( V_nominal(start = 110), redeclare Interfaces.Terminal_p terminal, redeclare replaceable Transmission.Grids.TestGrid2Nodes grid, redeclare Line lines( commercialCable=grid.cables, each use_C=use_C, each modelMode=modelMode)); parameter Boolean use_C = false "If true, model the cable capacity"; parameter Buildings.Electrical.Types.Load modelMode=Types.Load.FixedZ_steady_state "Select between steady state and dynamic model"; Modelica.SIunits.Voltage VAbs[grid.nNodes] "RMS voltage of the grid nodes"; equation for i in 1:grid.nLinks loop connect(lines[i].terminal_p, terminal[grid.fromTo[i,1]]); connect(lines[i].terminal_n, terminal[grid.fromTo[i,2]]); end for; for i in 1:grid.nNodes loop VAbs[i] = Buildings.Electrical.PhaseSystems.OnePhase.systemVoltage(terminal[i].v); end for; end Network;

Buildings.Electrical.AC.OnePhase.Lines.TwoPortInductance Buildings.Electrical.AC.OnePhase.Lines.TwoPortInductance

Model of an inductive element with two electrical ports

Buildings.Electrical.AC.OnePhase.Lines.TwoPortInductance

Information

This model represents an inductance that connects two AC one phase interfaces. This model can be used to represent a single phase cable in a AC grid.

The model represents the lumped inductance as shown in the figure below.

image

Extends from Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortInductance (Partial model of an inductive element that links two electrical connectors).

Parameters

TypeNameDefaultDescription
replaceable package PhaseSystem_pPartialPhaseSystemPhase system of terminal p
replaceable package PhaseSystem_nPartialPhaseSystemPhase system of terminal n
InductanceL Inductance [H]
Modeling assumption
LoadmodeBuildings.Electrical.Types.L...Type of model (e.g., steady state, dynamic, prescribed power consumption, etc.)

Connectors

TypeNameDescription
replaceable package PhaseSystem_pPhase system of terminal p
replaceable package PhaseSystem_nPhase system of terminal n

Modelica definition

model TwoPortInductance "Model of an inductive element with two electrical ports" extends Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortInductance ( redeclare package PhaseSystem_p = PhaseSystems.OnePhase, redeclare package PhaseSystem_n = PhaseSystems.OnePhase, redeclare Interfaces.Terminal_n terminal_n, redeclare Interfaces.Terminal_p terminal_p); parameter Buildings.Electrical.Types.Load mode( min=Buildings.Electrical.Types.Load.FixedZ_steady_state, max=Buildings.Electrical.Types.Load.VariableZ_y_input)= Buildings.Electrical.Types.Load.FixedZ_steady_state "Type of model (e.g., steady state, dynamic, prescribed power consumption, etc.)"; protected Modelica.SIunits.AngularVelocity omega "Frequency of the quasi-stationary sine waves"; equation omega = der(PhaseSystem_p.thetaRef(terminal_p.theta)); if mode==Buildings.Electrical.Types.Load.FixedZ_dynamic then // Dynamics of the system der(L*terminal_p.i) + L*omega*PhaseSystem_p.j(terminal_p.i) = terminal_p.v - terminal_n.v; else // Steady state relationship L*omega*PhaseSystem_p.j(terminal_p.i) = terminal_p.v - terminal_n.v; end if; end TwoPortInductance;

Buildings.Electrical.AC.OnePhase.Lines.TwoPortRL Buildings.Electrical.AC.OnePhase.Lines.TwoPortRL

Model of a resistive-inductive element with two electrical ports

Buildings.Electrical.AC.OnePhase.Lines.TwoPortRL

Information

This model represents a resistance and an inductance connected in series with two AC one phase interfaces. This model can be used to represent a single phase cable in a AC grid.

The model represents the lumped RL cable as shown in the figure below.

image

Extends from Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortRLC (Partial model of an RLC element that links two electrical connectors).

Parameters

TypeNameDefaultDescription
replaceable package PhaseSystem_pPartialPhaseSystemPhase system of terminal p
replaceable package PhaseSystem_nPartialPhaseSystemPhase system of terminal n
BooleanuseHeatPortfalse=true, if HeatPort is enabled
TemperatureTT_refFixed device temperature if useHeatPort = false [K]
ResistanceR Resistance at temperature T_ref [Ohm]
TemperatureT_ref298.15Reference temperature [K]
TemperatureM507.65Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref)) [K]
CapacitanceC0Capacity [F]
InductanceL Inductance [H]
Currenti_start[PhaseSystem_p.n]zeros(PhaseSystem_p.n)Initial current phasor of the line (positive if entering from terminal p) [A]
Nominal conditions
VoltageV_nominal0Nominal voltage (V_nominal >= 0) [V]
Modeling assumption
LoadmodeBuildings.Electrical.Types.L...Type of model (e.g., steady state, dynamic, prescribed power consumption, etc.)

Connectors

TypeNameDescription
replaceable package PhaseSystem_pPhase system of terminal p
replaceable package PhaseSystem_nPhase system of terminal n
HeatPort_aheatPort 

Modelica definition

model TwoPortRL "Model of a resistive-inductive element with two electrical ports" extends Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortRLC( final V_nominal=0, redeclare package PhaseSystem_p = PhaseSystems.OnePhase, redeclare package PhaseSystem_n = PhaseSystems.OnePhase, redeclare Interfaces.Terminal_n terminal_n, redeclare Interfaces.Terminal_p terminal_p, final C=0); parameter Modelica.SIunits.Current i_start[PhaseSystem_p.n] = zeros(PhaseSystem_p.n) "Initial current phasor of the line (positive if entering from terminal p)"; parameter Buildings.Electrical.Types.Load mode( min=Buildings.Electrical.Types.Load.FixedZ_steady_state, max=Buildings.Electrical.Types.Load.FixedZ_dynamic)= Buildings.Electrical.Types.Load.FixedZ_steady_state "Type of model (e.g., steady state, dynamic, prescribed power consumption, etc.)"; protected Modelica.SIunits.Current i_p[2](start = i_start, each stateSelect=StateSelect.prefer) "Current phasor at terminal p"; Modelica.SIunits.AngularVelocity omega "Frequency of the quasi-stationary sine waves"; initial equation if mode==Buildings.Electrical.Types.Load.FixedZ_dynamic then i_p = i_start; end if; equation omega = der(PhaseSystem_p.thetaRef(terminal_p.theta)); terminal_p.i = - terminal_n.i; i_p = terminal_p.i; if mode==Buildings.Electrical.Types.Load.FixedZ_dynamic then // Dynamics of the system der(L*i_p) + L*omega*PhaseSystem_p.j(i_p) + i_p*diagonal(ones(PhaseSystem_p.n)*R_actual) = terminal_p.v - terminal_n.v; else // steady state relationship L*omega*PhaseSystem_p.j(i_p) + i_p*diagonal(ones(PhaseSystem_p.n)*R_actual) = terminal_p.v - terminal_n.v; end if; // Joule losses LossPower = R_actual*(i_p[1]^2 + i_p[2]^2); end TwoPortRL;

Buildings.Electrical.AC.OnePhase.Lines.TwoPortRLC Buildings.Electrical.AC.OnePhase.Lines.TwoPortRLC

Model of an RLC element with two electrical ports

Buildings.Electrical.AC.OnePhase.Lines.TwoPortRLC

Information

This model represents a series of two resistive-inductive impedances and a capacitance that connects two AC single phase interfaces. This model can be used to represent a cable in a AC grid.

The model represents the lumped resistances and capacity, as a T-model, as shown in the figure below.

image

As can be seen in the figure, the resistance R and the inductance L are split in two halves and the capacitance is located in the center. The capacitance in the center is optional. If it is not present, set the parameter C=0. The model is either dynamic or static depending on the presence of the capacitive effect.

Extends from Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortRLC (Partial model of an RLC element that links two electrical connectors).

Parameters

TypeNameDefaultDescription
replaceable package PhaseSystem_pPartialPhaseSystemPhase system of terminal p
replaceable package PhaseSystem_nPartialPhaseSystemPhase system of terminal n
BooleanuseHeatPortfalse=true, if HeatPort is enabled
TemperatureTT_refFixed device temperature if useHeatPort = false [K]
ResistanceR Resistance at temperature T_ref [Ohm]
TemperatureT_ref298.15Reference temperature [K]
TemperatureM507.65Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref)) [K]
CapacitanceC Capacity [F]
InductanceL Inductance [H]
VoltageVc_start[2]{V_nominal,0}Initial voltage phasor of the capacitance located in the middle of the line [V]
Modeling assumption
LoadmodeBuildings.Electrical.Types.L...Type of model (e.g., steady state, dynamic, prescribed power consumption, etc.)

Connectors

TypeNameDescription
replaceable package PhaseSystem_pPhase system of terminal p
replaceable package PhaseSystem_nPhase system of terminal n
HeatPort_aheatPort 

Modelica definition

model TwoPortRLC "Model of an RLC element with two electrical ports" extends Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortRLC( V_nominal(start = 110), redeclare package PhaseSystem_p = PhaseSystems.OnePhase, redeclare package PhaseSystem_n = PhaseSystems.OnePhase, redeclare Interfaces.Terminal_n terminal_n( redeclare package PhaseSystem = PhaseSystem_n), redeclare Interfaces.Terminal_p terminal_p( redeclare package PhaseSystem = PhaseSystem_p)); parameter Modelica.SIunits.Voltage Vc_start[2] = {V_nominal,0} "Initial voltage phasor of the capacitance located in the middle of the line"; parameter Buildings.Electrical.Types.Load mode( min=Buildings.Electrical.Types.Load.FixedZ_steady_state, max=Buildings.Electrical.Types.Load.FixedZ_dynamic)= Buildings.Electrical.Types.Load.FixedZ_steady_state "Type of model (e.g., steady state, dynamic, prescribed power consumption, etc.)"; protected Modelica.SIunits.Voltage Vc[2](start = Vc_start, each stateSelect=StateSelect.prefer) "Voltage of the Capacitance located in the middle of the line"; Modelica.SIunits.Current Ic[2] "Currenbt of the capacitance located in the middle of the line"; Modelica.SIunits.AngularVelocity omega "Frequency of the quasi-stationary sine waves"; initial equation if C > 0 and mode == Buildings.Electrical.Types.Load.FixedZ_dynamic then Vc = Vc_start; end if; equation omega = der(PhaseSystem_p.thetaRef(terminal_p.theta)); terminal_p.i + terminal_n.i = Ic; L/2*omega*Buildings.Electrical.PhaseSystems.OnePhase.j(terminal_p.i) + terminal_p.i*diagonal(ones(PhaseSystem_p.n)*R_actual/2) = terminal_p.v - Vc; L/2*omega*Buildings.Electrical.PhaseSystems.OnePhase.j(terminal_n.i) + terminal_n.i*diagonal(ones(PhaseSystem_n.n)*R_actual/2) = terminal_n.v - Vc; if C > 0 then if mode == Buildings.Electrical.Types.Load.FixedZ_dynamic then // Dynamics of the system C*der(Vc) + omega*C*Buildings.Electrical.PhaseSystems.OnePhase.j(Vc) = Ic; else // steady state relationship omega*C*Buildings.Electrical.PhaseSystems.OnePhase.j(Vc) = Ic; end if; else // No capacitive effect, the voltage in the middle of the line is the linear // interpolation of the two phasors Vc = (terminal_p.v + terminal_n.v)/2; end if; // Joule losses LossPower = R_actual/2*(terminal_p.i[1]^2 + terminal_p.i[2]^2) + R_actual/2*(terminal_n.i[1]^2 + terminal_n.i[2]^2); end TwoPortRLC;

Buildings.Electrical.AC.OnePhase.Lines.TwoPortResistance Buildings.Electrical.AC.OnePhase.Lines.TwoPortResistance

Model of a resistance with two electrical ports

Buildings.Electrical.AC.OnePhase.Lines.TwoPortResistance

Information

This model represents a resistance that connects two AC one phase interfaces. This model can be used to represent a single phase cable in a AC grid.

The model represents the lumped resistance as shown in the figure below.

image

Extends from Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortResistance (Partial model of a resistive element that links two electrical connectors).

Parameters

TypeNameDefaultDescription
replaceable package PhaseSystem_pPartialPhaseSystemPhase system of terminal p
replaceable package PhaseSystem_nPartialPhaseSystemPhase system of terminal n
BooleanuseHeatPortfalse=true, if HeatPort is enabled
TemperatureTT_refFixed device temperature if useHeatPort = false [K]
ResistanceR Resistance at temperature T_ref [Ohm]
TemperatureT_ref298.15Reference temperature [K]
TemperatureM507.65Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref)) [K]

Connectors

TypeNameDescription
replaceable package PhaseSystem_pPhase system of terminal p
replaceable package PhaseSystem_nPhase system of terminal n
HeatPort_aheatPort 

Modelica definition

model TwoPortResistance "Model of a resistance with two electrical ports" extends Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortResistance ( redeclare package PhaseSystem_p = PhaseSystems.OnePhase, redeclare package PhaseSystem_n = PhaseSystems.OnePhase, redeclare Interfaces.Terminal_n terminal_n, redeclare Interfaces.Terminal_p terminal_p); equation terminal_p.v - terminal_n.v = terminal_p.i*diagonal(ones(PhaseSystem_p.n)*R_actual); // Joule losses LossPower = R_actual*(terminal_p.i[1]^2 + terminal_p.i[2]^2); end TwoPortResistance;

http://simulationresearch.lbl.gov/modelica