Description: "Package with models for DC electrical lines"

- Home > Modelica

## Buildings.Electrical.DC.Lines

Package with models for DC electrical lines

### Information

This package contains models for lines for DC circuits.

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

### Package Content

Name | Description
--- | ---
Line | Model of a DC electrical line
TwoPortRCLine | Model of a two port DC resistance and capacity (T-model)
TwoPortResistance | Model of a two port DC resistance
Examples | Package with example models

## Buildings.Electrical.DC.Lines.Line

Model of a DC electrical line

### Information

This model represents a DC cable. The model is based on Buildings.Electrical.DC.Lines.TwoPortRCLine and provides functionalities to parametrize the values of R and C either using commercial cables or using default values.

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

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
replaceable package PhaseSystem_p | PartialPhaseSystem | Phase system of terminal p
replaceable package PhaseSystem_n | PartialPhaseSystem | Phase system of terminal n
Length | l |  | Length of the line [m]
Power | P_nominal |  | Nominal power of the line [W]
Voltage | V_nominal |  | Nominal voltage of the line [V]
Model
Assumptions
Boolean | use_C | false | Set to true to add a capacitance in the center of the line
Load | modelMode | Types.Load.FixedZ_steady_state | Select between steady state and dynamic model
Thermal
Boolean | use_T | false | If true, enables the input for the temperature of the cable
Temperature | TCable | T_ref | Fixed temperature of the cable [K]
Tech. specification
Auto/Manual mode
CableMode | mode | Buildings.Electrical.Types.C... | Select if choosing the cable automatically or between a list of commercial options
Manual mode
Generic | commercialCable | Buildings.Electrical.Transmi... | Commercial cables options

### Connectors

Type | Name | Description
--- | --- | ---
replaceable package PhaseSystem_p | Phase system of terminal p
replaceable package PhaseSystem_n | Phase system of terminal n
input RealInput | T | Temperature of the cable

### Modelica definition

model Line "Model of a DC electrical line" extends Buildings.Electrical.Transmission.BaseClasses.PartialLine( redeclare package PhaseSystem_p = PhaseSystems.TwoConductor, redeclare package PhaseSystem_n = PhaseSystems.TwoConductor, redeclare Interfaces.Terminal_n terminal_n, redeclare Interfaces.Terminal_p terminal_p, final modelMode=Types.Load.FixedZ_steady_state, commercialCable = Buildings.Electrical.Transmission.Functions.selectCable_low(P_nominal, V_nominal)); TwoPortRCLine lineRC( final useHeatPort=true, final R=R, final V_nominal=V_nominal, final T_ref=T_ref, final M=M, final C=C, final use_C=use_C); equation connect(terminal_n, lineRC.terminal_n); connect(lineRC.terminal_p, terminal_p); connect(cableTemp.port, lineRC.heatPort); end Line;

## Buildings.Electrical.DC.Lines.TwoPortRCLine

Model of a two port DC resistance and capacity (T-model)

### Information

This model represents a series of two resistances and a capacitance that connect two DC interfaces. This model can be used to represent a cable in a DC grid.

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

As can be seen in the figure, the resistance R is split in two halves and the capacitance is located in the center. The capacitance in the center is optional and can be selected using the boolean flag `use_C = true`. 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

Type | Name | Default | Description
--- | --- | --- | ---
replaceable package PhaseSystem_p | PartialPhaseSystem | Phase system of terminal p
replaceable package PhaseSystem_n | PartialPhaseSystem | Phase system of terminal n
Boolean | useHeatPort | false | =true, if HeatPort is enabled
Temperature | T | T_ref | Fixed device temperature if useHeatPort = false [K]
Resistance | R |  | Resistance at temperature T_ref [Ohm]
Temperature | T_ref | 298.15 | Reference temperature [K]
Temperature | M | 507.65 | Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref)) [K]
Capacitance | C |  | Capacity [F]
Inductance | L | 0 | Inductance [H]
Voltage | Vc_start | V_nominal | Initial value of the voltage of the capacitance in the middle of the line [V]
Nominal conditions
Voltage | V_nominal |  | Nominal voltage (V_nominal >= 0) [V]
Model
Assumptions
Boolean | use_C | false | Set to true to add a capacitance in the center of the line

### Connectors

Type | Name | Description
--- | --- | ---
replaceable package PhaseSystem_p | Phase system of terminal p
replaceable package PhaseSystem_n | Phase system of terminal n
HeatPort_a | heatPort |

### Modelica definition

model TwoPortRCLine "Model of a two port DC resistance and capacity (T-model)" extends Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortRLC( redeclare package PhaseSystem_p = PhaseSystems.TwoConductor, redeclare package PhaseSystem_n = PhaseSystems.TwoConductor, redeclare Interfaces.Terminal_n terminal_n, redeclare Interfaces.Terminal_p terminal_p, final L=0); parameter Boolean use_C = false "Set to true to add a capacitance in the center of the line"; parameter Modelica.SIunits.Voltage Vc_start = V_nominal "Initial value of the voltage of the capacitance in the middle of the line"; Modelica.SIunits.Voltage Vc(start = Vc_start, stateSelect = StateSelect.prefer) "Voltage of the capacitor"; initial equation if C>0 and use_C then Vc = Vc_start; end if; equation terminal_p.v[1] - (Vc+terminal_p.v[2]) = terminal_p.i[1]*R_actual/2; terminal_n.v[1] - (Vc+terminal_p.v[2]) = terminal_n.i[1]*R_actual/2; if C>0 and use_C then C*der(Vc) = terminal_p.i[1] + terminal_n.i[1]; else Vc = 0.5*(terminal_p.v[1] - terminal_p.v[2] + terminal_n.v[1] - terminal_n.v[2]); end if; terminal_p.v[2] = terminal_n.v[2]; terminal_p.i[2] + terminal_n.i[2] = 0; // Joule losses LossPower = R_actual/2*terminal_p.i[1]^2 + R_actual/2*terminal_n.i[1]^2; end TwoPortRCLine;

## Buildings.Electrical.DC.Lines.TwoPortResistance

Model of a two port DC resistance

### Information

This model represents a resistance that connect two DC interfaces. This model can be used to represent a cable in a DC grid.

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

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

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
replaceable package PhaseSystem_p | PartialPhaseSystem | Phase system of terminal p
replaceable package PhaseSystem_n | PartialPhaseSystem | Phase system of terminal n
Boolean | useHeatPort | false | =true, if HeatPort is enabled
Temperature | T | T_ref | Fixed device temperature if useHeatPort = false [K]
Resistance | R |  | Resistance at temperature T_ref [Ohm]
Temperature | T_ref | 298.15 | Reference temperature [K]
Temperature | M | 507.65 | Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref)) [K]

### Connectors

Type | Name | Description
--- | --- | ---
replaceable package PhaseSystem_p | Phase system of terminal p
replaceable package PhaseSystem_n | Phase system of terminal n
HeatPort_a | heatPort |

### Modelica definition

model TwoPortResistance "Model of a two port DC resistance" extends Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortResistance ( redeclare package PhaseSystem_p = PhaseSystems.TwoConductor, redeclare package PhaseSystem_n = PhaseSystems.TwoConductor, redeclare Interfaces.Terminal_n terminal_n, redeclare Interfaces.Terminal_p terminal_p); equation // Voltage drop on the resistance lumped on connection between terminals // p.v[1] and n.v[1] terminal_p.v[1] - terminal_n.v[1] = terminal_p.i[1]*R_actual; terminal_p.v[2] = terminal_n.v[2]; // Joule losses LossPower = R_actual*terminal_p.i[1]^2; end TwoPortResistance;