Package with models for AC/AC and AC/DC conversion
Information
This package contains models for AC/AC and AC/DC conversion.
Extends from Modelica.Icons.Package (Icon for standard packages).
Package Content
Name |
Description |
ACACConverter
|
AC AC converter single phase systems |
ACACTransformer
|
AC AC transformer simplified equivalent circuit |
ACACTransformerFull
|
AC AC transformer with detailed equivalent circuit |
ACDCConverter
|
AC DC converter |
Examples
|
Package with example models |
AC AC converter single phase systems
Information
This is an AC/AC converter, based on a power balance between both circuit sides.
The parameter conversionFactor defines the ratio between the RMS voltages
as
V2 = conversionFactor V1
where V1 and V2 are the RMS voltages
at the primary and secondary sides of the transformer, i.e., the
connector N and P, respectively.
The loss of the converter is proportional to the power transmitted.
The parameter eta
is the efficiency of the transfer.
The loss is computed as
Ploss = (1-η) Ptr,
where Ptr is the power transmitted. The model is bi-directional
and the power can flow from the primary to the secondary side and vice-versa.
Furthermore, reactive power on both side are set to zero.
Note:
This model is derived from
Modelica.Electrical.QuasiStationary.SinglePhase.Utilities.IdealACDCConverter.
Extends from Buildings.Electrical.Icons.RefAngleConversion (Icon that represents if the angle symble should be displayed or not), Buildings.Electrical.Interfaces.PartialConversion (Model representing a generic two port system for conversion).
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 |
Real | conversionFactor | conversionFactor(min=Modelic... | Ratio of QS rms voltage on side 2 / QS rms voltage on side 1 |
Real | eta | eta(min=0, max=1) | Converter efficiency, pLoss = (1-eta) * Ptr |
Ground |
side 1 |
Boolean | ground_1 | false | If true, connect side 1 of converter to ground |
side 2 |
Boolean | ground_2 | true | If true, connect side 2 of converter to ground |
Connectors
Type | Name | Description |
replaceable package PhaseSystem_p | Phase system of terminal p |
replaceable package PhaseSystem_n | Phase system of terminal n |
Modelica definition
model ACACConverter
extends Buildings.Electrical.Icons.RefAngleConversion;
extends Buildings.Electrical.Interfaces.PartialConversion(
redeclare package PhaseSystem_p =
PhaseSystems.OnePhase,
redeclare package PhaseSystem_n =
PhaseSystems.OnePhase,
redeclare replaceable Interfaces.Terminal_n terminal_n
constrainedby Interfaces.Terminal_n(
i(start =
zeros(PhaseSystem_n.n),
each stateSelect = StateSelect.prefer)),
redeclare replaceable Interfaces.Terminal_p terminal_p
constrainedby Interfaces.Terminal_p(
i(start =
zeros(PhaseSystem_p.n),
each stateSelect = StateSelect.prefer)));
parameter Real conversionFactor(min = Modelica.Constants.eps)
;
parameter Real eta(min=0, max=1)
;
parameter Boolean ground_1 = false
;
parameter Boolean ground_2 = true
;
Modelica.SIunits.Power LossPower[2] ;
protected
Modelica.SIunits.Power P_p[2] =
PhaseSystem_p.phasePowers_vi(terminal_p.v, terminal_p.i)
;
Modelica.SIunits.Power P_n[2] =
PhaseSystem_n.phasePowers_vi(terminal_n.v, terminal_n.i)
;
equation
terminal_p.v = conversionFactor*terminal_n.v;
terminal_p.i[1] = terminal_n.i[1]/conversionFactor*
Buildings.Utilities.Math.Functions.spliceFunction(eta-2, 1/(eta-2), P_p[1], deltax=0.1);
terminal_p.i[2] = terminal_n.i[2]/conversionFactor*
Buildings.Utilities.Math.Functions.spliceFunction(eta-2, 1/(eta-2), P_p[1], deltax=0.1);
LossPower = P_p + P_n;
terminal_p.theta = terminal_n.theta;
if ground_1
then
Connections.potentialRoot(terminal_n.theta);
end if;
if ground_2
then
Connections.root(terminal_p.theta);
end if;
end ACACConverter;
AC AC transformer simplified equivalent circuit
Information
This is a simplified equivalent transformer model.
The model accounts for winding Joule losses and leakage reactances
that are represented by a series of a resistance R and an
inductance L. The resistance and the inductance represent both the
effects of the secondary and primary side of the transformer.
The model is parameterized using the following parameters
VHigh
- RMS voltage at primary side,
VLow
- RMS voltage at secondary side,
VABase
- apparent nominal power of the transformer,
XoverR
- ratio between reactance and resistance, and
Zperc
- the short circuit impedance.
Given the nominal conditions,the model computes the values of the resistance and the inductance.
Extends from Buildings.Electrical.Icons.RefAngleConversion (Icon that represents if the angle symble should be displayed or not), Buildings.Electrical.Interfaces.PartialConversion (Model representing a generic two port system for conversion).
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 |
Voltage | VHigh | | Rms voltage on side 1 of the transformer (primary side) [V] |
Voltage | VLow | | Rms voltage on side 2 of the transformer (secondary side) [V] |
ApparentPower | VABase | | Nominal power of the transformer [VA] |
Real | XoverR | | Ratio between the complex and real components of the impedance (XL/R) |
Real | Zperc | | Short circuit impedance |
Ground |
side 1 |
Boolean | ground_1 | false | If true, connect side 1 of converter to ground |
side 2 |
Boolean | ground_2 | true | If true, connect side 2 of converter to ground |
Initialization |
Angle | phi_1 | 0 | Angle of the voltage side 1 at initialization [rad] |
Angle | phi_2 | phi_1 | Angle of the voltage side 2 at initialization [rad] |
Connectors
Type | Name | Description |
replaceable package PhaseSystem_p | Phase system of terminal p |
replaceable package PhaseSystem_n | Phase system of terminal n |
Modelica definition
model ACACTransformer
extends Buildings.Electrical.Icons.RefAngleConversion;
extends Buildings.Electrical.Interfaces.PartialConversion(
redeclare package PhaseSystem_p =
PhaseSystems.OnePhase,
redeclare package PhaseSystem_n =
PhaseSystems.OnePhase,
redeclare replaceable Interfaces.Terminal_n terminal_n
constrainedby Interfaces.Terminal_n(
i(start =
zeros(PhaseSystem_n.n),
each stateSelect = StateSelect.prefer)),
redeclare replaceable Interfaces.Terminal_p terminal_p
constrainedby Interfaces.Terminal_p(
i(start =
zeros(PhaseSystem_p.n),
each stateSelect = StateSelect.prefer)));
parameter Modelica.SIunits.Voltage VHigh
;
parameter Modelica.SIunits.Voltage VLow
;
parameter Modelica.SIunits.ApparentPower VABase
;
parameter Real XoverR
;
parameter Real Zperc ;
parameter Boolean ground_1 = false
;
parameter Boolean ground_2 = true
;
parameter Modelica.SIunits.Angle phi_1 = 0
;
parameter Modelica.SIunits.Angle phi_2 = phi_1
;
Modelica.SIunits.Efficiency eta ;
Modelica.SIunits.Power PLoss[2] ;
Modelica.SIunits.Voltage V1[2](
start =
PhaseSystem_n.phaseVoltages(VHigh, phi_1))
;
Modelica.SIunits.Voltage V2[2](
start =
PhaseSystem_p.phaseVoltages(VLow, phi_2))
;
protected
Real N = VHigh/VLow ;
Modelica.SIunits.Current IHigh = VABase/VHigh
;
Modelica.SIunits.Current ILow = VABase/VLow
;
Modelica.SIunits.Current IscHigh = IHigh/Zperc
;
Modelica.SIunits.Current IscLow = ILow/Zperc
;
Modelica.SIunits.Impedance Zp = VHigh/IscHigh
;
Modelica.SIunits.Impedance Z1[2]=
{Zp*
cos(
atan(XoverR)), Zp*
sin(
atan(XoverR))}
;
Modelica.SIunits.Impedance Zs = VLow/IscLow
;
Modelica.SIunits.Impedance Z2[2]=
{Zs*
cos(
atan(XoverR)), Zs*
sin(
atan(XoverR))}
;
Modelica.SIunits.Power P_p[2]=
PhaseSystem_p.phasePowers_vi(terminal_p.v, terminal_p.i)
;
Modelica.SIunits.Power P_n[2]=
PhaseSystem_n.phasePowers_vi(terminal_n.v, terminal_n.i)
;
Modelica.SIunits.Power S_p =
Modelica.Fluid.Utilities.regRoot(P_p[1]^2 + P_p[2]^2, delta=0.1)
;
Modelica.SIunits.Power S_n =
Modelica.Fluid.Utilities.regRoot(P_n[1]^2 + P_n[2]^2, delta=0.1)
;
equation
eta =
Buildings.Utilities.Math.Functions.smoothMin(
x1=
Modelica.Fluid.Utilities.regRoot(P_p[1]^2 + P_p[2]^2, delta=0.01)/
Modelica.Fluid.Utilities.regRoot(P_n[1]^2 + P_n[2]^2 + 1e-6, delta=0.01),
x2=
Modelica.Fluid.Utilities.regRoot(P_n[1]^2 + P_n[2]^2, delta=0.01)/
Modelica.Fluid.Utilities.regRoot(P_p[1]^2 + P_p[2]^2 + 1e-6, delta=0.01),
deltaX = 0.01);
V2 = V1/N;
terminal_p.i[1] + terminal_n.i[1]*N = 0;
terminal_p.i[2] + terminal_n.i[2]*N = 0;
terminal_n.v = V1 +
Buildings.Electrical.PhaseSystems.OnePhase.product(
terminal_n.i, Z1);
V2 = terminal_p.v;
PLoss = P_p + P_n;
terminal_p.theta = terminal_n.theta;
if ground_1
then
Connections.potentialRoot(terminal_n.theta);
end if;
if ground_2
then
Connections.root(terminal_p.theta);
end if;
end ACACTransformer;
AC AC transformer with detailed equivalent circuit
Information
This is a detailed transformer model that takes into account the winding Joule losses
and the leakage reactances on both primary and secondary side. The model also describes
the core or iron losses and the losses due to magnetization effects.
The losses are represented by a series of resistances R1, R2,
Rm and inductances L1, L2, and
Lm.
The model is parameterized using the following parameters
VHigh
- RMS voltage at primary side,
VLow
- RMS voltage at secondary side,
VABase
- apparent nominal power of the transformer,
f
- frequency,
R_1, L_1
- resistance and inductance at primary side (per unit),
R_2, L_2
- resistance and inductance at secondary side (per unit), and
R_m, L_m
- resistance and inductance for magnetization effects (per unit).
Given the nominal conditions, the model computes the values of the nominal impedances
at both primary and secondary side. Given these values, the per unit values are transformed into
the actual values of the resistances and inductances.
The magnetization losses can be enabled or disabled using the boolean flag magEffects
.
Extends from Buildings.Electrical.Icons.RefAngleConversion (Icon that represents if the angle symble should be displayed or not), Buildings.Electrical.Interfaces.PartialConversion (Model representing a generic two port system for conversion).
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 |
Voltage | VHigh | | RMS voltage on side 1 of the transformer (primary side) [V] |
Voltage | VLow | | RMS voltage on side 2 of the transformer (secondary side) [V] |
ApparentPower | VABase | | Nominal power of the transformer [VA] |
Frequency | f | f(start=60) | Nominal frequency [Hz] |
PerUnit | R1 | R1(min=0) | Resistance on side 1 of the transformer (pu) [1] |
PerUnit | L1 | L1(min=0) | Inductance on side 1 of the transformer (pu) [1] |
PerUnit | R2 | R2(min=0) | Resistance on side 2 of the transformer (pu) [1] |
PerUnit | L2 | L2(min=0) | Inductance on side 2 of the transformer (pu) [1] |
Magnetization |
Boolean | magEffects | false | If true, introduce magnetization effects |
PerUnit | Rm | Rm(min=0) | Magnetization resistance (pu) [1] |
PerUnit | Lm | Lm(min=0) | Magnetization inductance (pu) [1] |
Ground |
side 1 |
Boolean | ground_1 | false | Connect side 1 of converter to ground |
side 2 |
Boolean | ground_2 | true | Connect side 2 of converter to ground |
Initialization |
Angle | phi_1 | 0 | Angle of the voltage side 1 at initialization [rad] |
Angle | phi_2 | phi_1 | Angle of the voltage side 2 at initialization [rad] |
Connectors
Type | Name | Description |
replaceable package PhaseSystem_p | Phase system of terminal p |
replaceable package PhaseSystem_n | Phase system of terminal n |
Modelica definition
model ACACTransformerFull
extends Buildings.Electrical.Icons.RefAngleConversion;
extends Buildings.Electrical.Interfaces.PartialConversion(
redeclare package PhaseSystem_p =
PhaseSystems.OnePhase,
redeclare package PhaseSystem_n =
PhaseSystems.OnePhase,
redeclare replaceable Interfaces.Terminal_n terminal_n
constrainedby Interfaces.Terminal_n(
i(start =
zeros(PhaseSystem_n.n),
each stateSelect = StateSelect.prefer)),
redeclare replaceable Interfaces.Terminal_p terminal_p
constrainedby Interfaces.Terminal_p(
i(start =
zeros(PhaseSystem_p.n),
each stateSelect = StateSelect.prefer)));
parameter Modelica.SIunits.Voltage VHigh
;
parameter Modelica.SIunits.Voltage VLow
;
parameter Modelica.SIunits.ApparentPower VABase
;
parameter Modelica.SIunits.Frequency f(start=60) ;
parameter Buildings.Electrical.Types.PerUnit R1(min=0)
;
parameter Buildings.Electrical.Types.PerUnit L1(min=0)
;
parameter Buildings.Electrical.Types.PerUnit R2(min=0)
;
parameter Buildings.Electrical.Types.PerUnit L2(min=0)
;
parameter Boolean magEffects = false
;
parameter Buildings.Electrical.Types.PerUnit Rm(min=0)
;
parameter Buildings.Electrical.Types.PerUnit Lm(min=0)
;
parameter Boolean ground_1 = false ;
parameter Boolean ground_2 = true ;
parameter Modelica.SIunits.Angle phi_1 = 0
;
parameter Modelica.SIunits.Angle phi_2 = phi_1
;
Modelica.SIunits.Efficiency eta ;
Modelica.SIunits.Power PLoss[2] ;
Modelica.SIunits.Voltage V1[2](start =
PhaseSystem_n.phaseVoltages(VHigh, phi_1))
;
Modelica.SIunits.Voltage V2[2](start =
PhaseSystem_n.phaseVoltages(VLow, phi_2))
;
protected
parameter Modelica.SIunits.AngularVelocity omega_n = 2*Modelica.Constants.pi*f;
parameter Real N = VHigh/VLow ;
parameter Modelica.SIunits.Resistance RBaseHigh = VHigh^2/VABase
;
parameter Modelica.SIunits.Resistance RBaseLow = VLow^2/VABase
;
Modelica.SIunits.Impedance Z1[2] = {RBaseHigh*R1, omega*L1*RBaseHigh/omega_n}
;
Modelica.SIunits.Impedance Z2[2] = {RBaseLow*R2, omega*L2*RBaseLow/omega_n}
;
Modelica.SIunits.Impedance Zrm[2] = {RBaseHigh*Rm, 0}
;
Modelica.SIunits.Impedance Zlm[2] = {0, omega*Lm*RBaseHigh/omega_n}
;
Modelica.SIunits.Power P_p[2] =
PhaseSystem_p.phasePowers_vi(terminal_p.v, terminal_p.i)
;
Modelica.SIunits.Power P_n[2] =
PhaseSystem_n.phasePowers_vi(terminal_n.v, terminal_n.i)
;
Modelica.SIunits.Power S_p =
Modelica.Fluid.Utilities.regRoot(P_p[1]^2 + P_p[2]^2, delta=0.1)
;
Modelica.SIunits.Power S_n =
Modelica.Fluid.Utilities.regRoot(P_n[1]^2 + P_n[2]^2, delta=0.1)
;
Modelica.SIunits.AngularVelocity omega ;
Modelica.SIunits.Current Im[2] ;
Modelica.SIunits.Angle theRef ;
equation
assert(
sqrt(P_p[1]^2 + P_p[2]^2) <= VABase*1.01,
"The load power of the transformer is higher than VABase");
theRef =
PhaseSystem_p.thetaRef(terminal_p.theta);
omega =
der(theRef);
eta =
Buildings.Utilities.Math.Functions.smoothMin(
x1=
Modelica.Fluid.Utilities.regRoot(P_p[1]^2 + P_p[2]^2, delta=0.01)/
Modelica.Fluid.Utilities.regRoot(P_n[1]^2 + P_n[2]^2 + 1e-6, delta=0.01),
x2=
Modelica.Fluid.Utilities.regRoot(P_n[1]^2 + P_n[2]^2, delta=0.01)/
Modelica.Fluid.Utilities.regRoot(P_p[1]^2 + P_p[2]^2 + 1e-6, delta=0.01),
deltaX = 0.01);
V2 = V1/N;
terminal_p.i[1] + (terminal_n.i[1] - Im[1])*N = 0;
terminal_p.i[2] + (terminal_n.i[2] - Im[2])*N = 0;
if magEffects
then
Im =
Buildings.Electrical.PhaseSystems.OnePhase.divide(V1, Zrm) +
Buildings.Electrical.PhaseSystems.OnePhase.divide(V1, Zlm);
else
Im =
zeros(2);
end if;
terminal_n.v = V1 +
Buildings.Electrical.PhaseSystems.OnePhase.product(
terminal_n.i, Z1);
terminal_p.v = V2 +
Buildings.Electrical.PhaseSystems.OnePhase.product(
terminal_p.i, Z2);
PLoss = P_p + P_n;
terminal_p.theta = terminal_n.theta;
if ground_1
then
Connections.potentialRoot(terminal_n.theta);
end if;
if ground_2
then
Connections.root(terminal_p.theta);
end if;
end ACACTransformerFull;
AC DC converter
Information
This is an AC/DC converter, based on a power balance between both circuit sides.
The parameter conversionFactor
defines the ratio between the RMS voltages
as
VDC = conversionFactor VAC,
where VDC is the voltage of the DC circuit and VAC
is the RMS voltage at the primary side of the transformer.
The loss of the converter is proportional to the power transmitted.
The parameter eta
is the efficiency of the transfer.
The loss is computed as
Ploss = (1-η) Ptr
where Ptr is the power transmitted. The model is bi-directional
and the power can flow from both the primary to the secondary side and vice-versa.
Furthermore, reactive power on both side are set to 0.
Note:
This model is derived from
Modelica.Electrical.QuasiStationary.SinglePhase.Utilities.IdealACDCConverter.
Extends from Buildings.Electrical.Interfaces.PartialConversion (Model representing a generic two port system for conversion).
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 |
Real | conversionFactor | conversionFactor(min=Modelic... | Ratio of DC voltage / AC RMS voltage |
Real | eta | eta(min=0, max=1) | Converter efficiency, pLoss = (1-eta) * Ptr |
Ground |
AC side |
Boolean | ground_AC | false | Connect AC side of converter to ground |
DC side |
Boolean | ground_DC | true | Connect DC side of converter to ground |
Connectors
Type | Name | Description |
replaceable package PhaseSystem_p | Phase system of terminal p |
replaceable package PhaseSystem_n | Phase system of terminal n |
Modelica definition
model ACDCConverter
extends Buildings.Electrical.Interfaces.PartialConversion(
redeclare package PhaseSystem_p =
PhaseSystems.TwoConductor,
redeclare package PhaseSystem_n =
PhaseSystems.OnePhase,
redeclare replaceable Interfaces.Terminal_n terminal_n
constrainedby Interfaces.Terminal_n(
i(start =
zeros(PhaseSystem_n.n),
each stateSelect = StateSelect.prefer)),
redeclare DC.Interfaces.Terminal_p terminal_p(
i(start =
zeros(PhaseSystem_p.n),
each stateSelect = StateSelect.prefer)));
parameter Real conversionFactor(min = Modelica.Constants.eps)
;
parameter Real eta(min=0, max=1)
;
Modelica.SIunits.Power PLoss ;
parameter Boolean ground_AC = false ;
parameter Boolean ground_DC = true ;
protected
PhaseSystem_p.Current i_dc ;
PhaseSystem_p.Voltage v_dc ;
Modelica.SIunits.Power P_p[2] =
PhaseSystem_p.phasePowers_vi(terminal_p.v, terminal_p.i)
;
Modelica.SIunits.Power P_n[2](
each start=0)=
PhaseSystem_n.phasePowers_vi(terminal_n.v, terminal_n.i)
;
equation
v_p = v_n*conversionFactor;
PLoss = (1-eta)*
Buildings.Utilities.Math.Functions.spliceFunction(P_p[1], P_n[1], i_p, deltax=0.1);
P_n + P_p = {PLoss, 0};
if ground_AC
then
Connections.potentialRoot(terminal_n.theta);
end if;
if ground_DC
then
v_dc = 0;
Connections.root(terminal_p.theta);
else
i_dc = 0;
Connections.potentialRoot(terminal_p.theta);
end if;
v_dc = terminal_p.v[2];
sum(terminal_p.i) + i_dc = 0;
end ACDCConverter;