Description: "Package that contains partial models for lines and cables"

- Home > Modelica

## Buildings.Electrical.Transmission.BaseClasses

Package that contains partial models for lines and cables

### Information

This package contains partial models that describe electric lines and cables.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

### Package Content

Name | Description
--- | ---
PartialBaseLine | Partial cable line dispersion model
PartialLine | Partial cable line dispersion model
PartialNetwork | Partial model that represent an electric network
PartialTwoPortInductance | Partial model of an inductive element that links two electrical connectors
PartialTwoPortRLC | Partial model of an RLC element that links two electrical connectors
PartialTwoPortResistance | Partial model of a resistive element that links two electrical connectors
BaseCable | Record that contains the properties of a generic cable

## Buildings.Electrical.Transmission.BaseClasses.PartialBaseLine

Partial cable line dispersion model

### Information

This partial model contains parameters and variables needed to parametrize a generic cable. The resistance, inductance and capacitance are computed by the functions associated to the type of cable selected. The type of cable is specified using a record that inherits from Buildings.Electrical.Transmission.BaseClasses.BaseCable such as ( Buildings.Electrical.Transmission.LowVoltageCables.Generic or Buildings.Electrical.Transmission.MediumVoltageCables.Generic). The record contains functions that depending on the properties of cable compute its resistance, inductance or capacitance.

The model has two parameters `use_C` and `modelMode` that change the behaviour of the model. It is possible to include the effects of a capacity or select the model to be dynamic or steady state. More information are available in the line models that extends this partial model.

#### Commercial cable mode

If `mode = commercial`, the user can select the type of cable from a list of commercial cables. The cables are divided in three different categories:

- Low voltage,
- Medium voltage, and
- High voltage.

The details and type of cables can be found in Buildings.Electrical.Transmission.LowVoltageCables and Buildings.Electrical.Transmission.MediumVoltageCables.

#### Automatic cable mode

If `mode = automatic`, the type of cable is automatically selected depending on the value of the parameters `V_nominal` and `P_nominal`.

#### Note:

More details about the functions that compute the type of cable and its properties can be found in Buildings.Electrical.Transmission.Functions.

The parameter `commercialCable` is assumed to be Buildings.Electrical.Transmission.LowVoltageCables.Generic. The parameter is replaceable so it can be redeclared using a different type, for example Buildings.Electrical.Transmission.MediumVoltageCables.Generic.
The example models Buildings.Electrical.AC.ThreePhasesBalanced.Lines.Examples.AClineMedium and Buildings.Electrical.AC.ThreePhasesBalanced.Lines.Examples.ACSimpleGridMedium show how this can be done.

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
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 | Buildings.Electrical.Types.L... | 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 | redeclare parameter Building... | Commercial cables options

### Connectors

Type | Name | Description
--- | --- | ---
input RealInput | T | Temperature of the cable

### Modelica definition

partial model PartialBaseLine "Partial cable line dispersion model" parameter Modelica.SIunits.Length l(min=0) "Length of the line"; parameter Modelica.SIunits.Power P_nominal(min=0) "Nominal power of the line"; parameter Modelica.SIunits.Voltage V_nominal(min=0, start=220) "Nominal voltage of the line"; final parameter Modelica.SIunits.Frequency f_n = 50 "Frequency considered in the definition of cables properties"; parameter Boolean use_C = false "Set to true to add a capacitance in the center of the line"; parameter Buildings.Electrical.Types.Load modelMode=Buildings.Electrical.Types.Load.FixedZ_steady_state "Select between steady state and dynamic model"; parameter Boolean use_T = false "If true, enables the input for the temperature of the cable"; parameter Modelica.SIunits.Temperature TCable = T_ref "Fixed temperature of the cable"; parameter Buildings.Electrical.Types.CableMode mode=Buildings.Electrical.Types.CableMode.automatic "Select if choosing the cable automatically or between a list of commercial options"; replaceable parameter Buildings.Electrical.Transmission.LowVoltageCables.Generic commercialCable constrainedby Buildings.Electrical.Transmission.BaseClasses.BaseCable "Commercial cables options"; final parameter Modelica.SIunits.Temperature T_ref = commercialCable.T_ref "Reference temperature of the line"; final parameter Modelica.SIunits.Temperature M = commercialCable.M "Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref))"; final parameter Modelica.SIunits.Resistance R = commercialCable.lineResistance(l, f_n, commercialCable) "Resistance of the cable"; final parameter Modelica.SIunits.Inductance L = commercialCable.lineInductance(l, f_n, commercialCable) "Inductance of the cable due to mutual and self inductance"; final parameter Modelica.SIunits.Capacitance C = commercialCable.lineCapacitance(l, f_n, commercialCable) "Capacitance of the cable"; Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature cableTemp "Temperature of the cable"; Modelica.Blocks.Interfaces.RealInput T if use_T "Temperature of the cable"; Modelica.Blocks.Sources.RealExpression cableTemperature(y=T_in) "Temperature of the cable"; protected Modelica.Blocks.Interfaces.RealInput T_in "Internal variable for conditional temperature"; equation assert(L>=0 and R>=0 and C>=0, "The parameters R,L,C must be positive. Check cable properties and size."); connect(T_in, T); if not use_T then T_in = TCable; end if; connect(cableTemperature.y, cableTemp.T); end PartialBaseLine;

## Buildings.Electrical.Transmission.BaseClasses.PartialLine

Partial cable line dispersion model

### Information

This partial model extends the model Buildings.Electrical.Transmission.Base.PartialBaseLine. It adds two generalized electric connectors.

#### Note:

See Buildings.Electrical.Transmission.Base.PartialBaseLine for more information.

Extends from Buildings.Electrical.Interfaces.PartialTwoPort (Model of a generic two port component with phase systems), Buildings.Electrical.Transmission.BaseClasses.PartialBaseLine (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
Terminal | terminal_n | redeclare replaceable Buildi... | Electric terminal side p
Terminal | terminal_p | redeclare replaceable Buildi... | Electric terminal side 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 | Buildings.Electrical.Types.L... | 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 | redeclare parameter Building... | Commercial cables options

### Connectors

Type | Name | Description
--- | --- | ---
Terminal | terminal_n | Electric terminal side p
Terminal | terminal_p | Electric terminal side n
input RealInput | T | Temperature of the cable

### Modelica definition

partial model PartialLine "Partial cable line dispersion model" extends Buildings.Electrical.Interfaces.PartialTwoPort; extends Buildings.Electrical.Transmission.BaseClasses.PartialBaseLine; Real VoltageLosses(unit = "1") = abs(PhaseSystem_p.systemVoltage(terminal_p.v) - PhaseSystem_n.systemVoltage(terminal_n.v))/ Buildings.Utilities.Math.Functions.smoothMax( PhaseSystem_p.systemVoltage(terminal_p.v), PhaseSystem_n.systemVoltage(terminal_n.v), 1.0) "Percentage of voltage losses across the line"; protected parameter Integer n_ = size(terminal_n.i,1) "Number of cables"; parameter Real nominal_i_ = P_nominal / V_nominal "Nominal current flowing through the line"; parameter Real nominal_v_ = V_nominal "Nominal voltage of the line"; end PartialLine;

## Buildings.Electrical.Transmission.BaseClasses.PartialNetwork

Partial model that represent an electric network

### Information

This partial model represents a generalized electrical network.

The model has three main components. The parameter `grid` declares the type Buildings.Electrical.Transmission.Grids.PartialGrid that contains the information about the topology of the network, such as the number of nodes, how they are connected, and the length of each connection. The parameter `terminal[...]` declares an array of generalized electric connectors that are associated to each node of the grid. The parameter `lines[...]` is an array of type Buildings.Electrical.Transmission.Base.PartialBaseLine that represent the cables in the grid.

#### Note:

This is a partial model that once extended can represent either DC or AC networks. This model is based on the assumption that the topology of the network does not depend on the type of cables that connect the nodes.

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Voltage | V_nominal |  | Nominal voltage of the lines in the network [V]
PartialGrid | grid | redeclare parameter Building... | Record that describe the grid with the number of nodes, links, connections, etc.
BaseTerminal | terminal[grid.nNodes] | redeclare Buildings.Electric... | Electric terminals for each node of the network
PartialBaseLine | lines[grid.nLinks] | redeclare Buildings.Electric... | Array of line models, each line connecting two nodes of the grid

### Connectors

Type | Name | Description
--- | --- | ---
BaseTerminal | terminal[grid.nNodes] | Electric terminals for each node of the network

### Modelica definition

partial model PartialNetwork "Partial model that represent an electric network" parameter Modelica.SIunits.Voltage V_nominal(min=0, start = 110) "Nominal voltage of the lines in the network"; replaceable parameter Buildings.Electrical.Transmission.Grids.PartialGrid grid "Record that describe the grid with the number of nodes, links, connections, etc."; replaceable Buildings.Electrical.Interfaces.BaseTerminal terminal[grid.nNodes] "Electric terminals for each node of the network"; replaceable Buildings.Electrical.Transmission.BaseClasses.PartialBaseLine lines[grid.nLinks]( each mode=Buildings.Electrical.Types.CableMode.commercial, l=grid.l[:, 1], each P_nominal=1000, each V_nominal=V_nominal) "Array of line models, each line connecting two nodes of the grid"; end PartialNetwork;

## Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortInductance

Partial model of an inductive element that links two electrical connectors

### Information

Partial model of an inductance that links two generalized electrical connectors.

Extends from Interfaces.PartialTwoPort (Model of a generic two port component with phase systems).

### 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
Terminal | terminal_n | redeclare replaceable Buildi... | Electric terminal side p
Terminal | terminal_p | redeclare replaceable Buildi... | Electric terminal side n
Inductance | L |  | Inductance [H]

### Connectors

Type | Name | Description
--- | --- | ---
Terminal | terminal_n | Electric terminal side p
Terminal | terminal_p | Electric terminal side n

### Modelica definition

partial model PartialTwoPortInductance "Partial model of an inductive element that links two electrical connectors" extends Interfaces.PartialTwoPort; parameter Modelica.SIunits.Inductance L "Inductance"; equation Connections.branch(terminal_p.theta, terminal_n.theta); terminal_p.theta = terminal_n.theta; terminal_p.i = - terminal_n.i; end PartialTwoPortInductance;

## Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortRLC

Partial model of an RLC element that links two electrical connectors

### Information

Partial model of a resistance that links two generalized electrical connectors.

The model computes a resistance R(T) that varies depending on the temperature T as

R(T) = Rref (M + T)/(M + Tref),

where the resistance Rref is the reference value of the resistance, M is the temperature coefficient of the cable material, and Tref is the reference temperature. The temperature T is the temperature of the heat port if `useHeatPort = true`.

The impedance L and the capacity C do not vary with respect to the temperature and are specified by the user.

Extends from Buildings.Electrical.Interfaces.PartialTwoPort (Model of a generic two port component with phase systems), Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort (Partial model to include a conditional HeatPort in order to describe the power loss via a thermal network).

### 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
Terminal | terminal_n | redeclare replaceable Buildi... | Electric terminal side p
Terminal | terminal_p | redeclare replaceable Buildi... | Electric terminal side 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 |  | Inductance [H]
Nominal conditions
Voltage | V_nominal |  | Nominal voltage (V_nominal >= 0) [V]

### Connectors

Type | Name | Description
--- | --- | ---
Terminal | terminal_n | Electric terminal side p
Terminal | terminal_p | Electric terminal side n
HeatPort_a | heatPort |

### Modelica definition

partial model PartialTwoPortRLC "Partial model of an RLC element that links two electrical connectors" extends Buildings.Electrical.Interfaces.PartialTwoPort; extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = T_ref); parameter Modelica.SIunits.Resistance R "Resistance at temperature T_ref"; parameter Modelica.SIunits.Temperature T_ref = 298.15 "Reference temperature"; parameter Modelica.SIunits.Temperature M = 507.65 "Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref))"; parameter Modelica.SIunits.Capacitance C "Capacity"; parameter Modelica.SIunits.Inductance L "Inductance"; parameter Modelica.SIunits.Voltage V_nominal(min=0, start = 110) "Nominal voltage (V_nominal >= 0)"; Modelica.SIunits.Resistance R_actual "Actual resistance = R*(M + T_heatPort)/(M + T_ref) "; equation Connections.branch(terminal_p.theta, terminal_n.theta); terminal_p.theta = terminal_n.theta; assert(R_actual>=0, "The value of R_actual must be positive, check reference and actual temperatures"); R_actual = R*(M + Modelica.SIunits.Conversions.to_degC(T_heatPort))/ (M + Modelica.SIunits.Conversions.to_degC(T_ref)); end PartialTwoPortRLC;

## Buildings.Electrical.Transmission.BaseClasses.PartialTwoPortResistance

Partial model of a resistive element that links two electrical connectors

### Information

Partial model of a resistance that links two generalized electrical connectors.

The model computes a resistance R(T) that varies depending on the temperature T as

R(T) = Rref (M + T)/(M + Tref),

where the resistance Rref is the reference value of the resistance, M is the temperature coefficient of the cable material, and Tref is the reference temperature. The temperature T is the temperature of the heat port if `useHeatPort = true`.

Extends from Interfaces.PartialTwoPort (Model of a generic two port component with phase systems), Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort (Partial model to include a conditional HeatPort in order to describe the power loss via a thermal network).

### 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
Terminal | terminal_n | redeclare replaceable Buildi... | Electric terminal side p
Terminal | terminal_p | redeclare replaceable Buildi... | Electric terminal side 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
--- | --- | ---
Terminal | terminal_n | Electric terminal side p
Terminal | terminal_p | Electric terminal side n
HeatPort_a | heatPort |

### Modelica definition

partial model PartialTwoPortResistance "Partial model of a resistive element that links two electrical connectors" extends Interfaces.PartialTwoPort; extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = T_ref); parameter Modelica.SIunits.Resistance R "Resistance at temperature T_ref"; parameter Modelica.SIunits.Temperature T_ref = 298.15 "Reference temperature"; parameter Modelica.SIunits.Temperature M = 507.65 "Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref))"; Modelica.SIunits.Resistance R_actual "Actual resistance = R*(M + T_heatPort)/(M + T_ref) "; equation Connections.branch(terminal_p.theta, terminal_n.theta); terminal_p.theta = terminal_n.theta; assert(R_actual>=0, "The value of R_actual must be positive, check reference and actual temperatures."); R_actual = R*(M + Modelica.SIunits.Conversions.to_degC(T_heatPort))/ (M + Modelica.SIunits.Conversions.to_degC(T_ref)); terminal_p.i = - terminal_n.i; end PartialTwoPortResistance;

## Buildings.Electrical.Transmission.BaseClasses.BaseCable

Record that contains the properties of a generic cable

### Information

This record contains the basic properties to describe a commercial cable.

The low voltage and medium voltage cables extends this base records and add other specific parameters like the geometrical properties.

The record contains four partial replaceable functions used to compute the properties of the cable such its resistance, inductance or capacitance.

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Material | material | Buildings.Electrical.Transmi... | Material of the cable
Current | Amp | 0.0 | Ampacitance of the cable [A]
Temperature | T_ref | 298.15 | Reference cable temperature [K]
Temperature | M | 228.1 + 273.15 | Temperature constant of the material [K]
replaceable function lineResistance |  | Function that computes the resistance of a cable
replaceable function lineInductance |  | Function that computes the inductance of a cable
replaceable function lineCapacitance |  | Function that computes the capacitance of a cable

### Modelica definition

record BaseCable "Record that contains the properties of a generic cable" parameter Buildings.Electrical.Transmission.Types.Material material = Buildings.Electrical.Transmission.Types.Material.Al "Material of the cable"; parameter Modelica.SIunits.Current Amp(start=0.0)=0.0 "Ampacitance of the cable"; parameter Modelica.SIunits.Temperature T_ref = 298.15 "Reference cable temperature"; parameter Modelica.SIunits.Temperature M = 228.1 + 273.15 "Temperature constant of the material"; replaceable partial function lineResistance "Function that computes the resistance of a cable" extends Modelica.Icons.Function; input Modelica.SIunits.Length l "Length of the cable"; input Modelica.SIunits.Frequency f = 50 "Frequency considered in the definition of cables properties"; output Modelica.SIunits.Resistance R "Resistance of the cable"; protected parameter Modelica.SIunits.AngularVelocity omega = 2*Modelica.Constants.pi*f; end lineResistance; replaceable partial function lineInductance "Function that computes the inductance of a cable" extends Modelica.Icons.Function; input Modelica.SIunits.Length l "Length of the cable"; input Modelica.SIunits.Frequency f = 50 "Frequency considered in the definition of cables properties"; output Modelica.SIunits.Inductance L "Inductance of the cable"; protected parameter Modelica.SIunits.AngularVelocity omega = 2*Modelica.Constants.pi*f; end lineInductance; replaceable partial function lineCapacitance "Function that computes the capacitance of a cable" extends Modelica.Icons.Function; input Modelica.SIunits.Length l "Length of the cable"; input Modelica.SIunits.Frequency f = 50 "Frequency considered in the definition of cables properties"; output Modelica.SIunits.Capacitance C "Capacitance of the cable"; protected parameter Modelica.SIunits.AngularVelocity omega = 2*Modelica.Constants.pi*f; end lineCapacitance; end BaseCable;