diff --git a/IBPSA/Electrical/AC/Interfaces/PowerOutput.mo b/IBPSA/Electrical/AC/Interfaces/PowerOutput.mo new file mode 100644 index 0000000000..c80ee34f2e --- /dev/null +++ b/IBPSA/Electrical/AC/Interfaces/PowerOutput.mo @@ -0,0 +1,33 @@ +within IBPSA.Electrical.AC.Interfaces; +connector PowerOutput + "Connector with real power, reactive power and power factor" + output Modelica.Units.SI.Power real "Real power"; + output Modelica.Units.SI.ReactivePower apparent "Apparent power"; + output Modelica.Units.SI.Angle phi "Phase shift"; + output Real cosPhi "Power factor"; + + annotation (Icon(graphics={ Polygon( + points={{-100,100},{100,0},{-100,-100},{-100,100}}, + lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Diagram(graphics={ + Polygon( + points={{-100,50},{0,0},{-100,-50},{-100,50}}, + lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Text( + extent={{30,110},{30,60}}, + textColor={0,0,127}, + textString="%name")}), + Documentation(info=" +This connector contains multiple quantities that can be used to monitor +the power consumption of a generic AC systems. +", revisions=" + +")); +end PowerOutput; diff --git a/IBPSA/Electrical/AC/Interfaces/package.mo b/IBPSA/Electrical/AC/Interfaces/package.mo new file mode 100644 index 0000000000..c57b5b9ba9 --- /dev/null +++ b/IBPSA/Electrical/AC/Interfaces/package.mo @@ -0,0 +1,12 @@ +within IBPSA.Electrical.AC; +package Interfaces "Package that contains some useful interfaces" +extends Modelica.Icons.InterfacesPackage; + + +annotation (Documentation(info=" +

+This package contains interfaces that are used by the models in the +IBPSA.Electrical.AC package. +

+")); +end Interfaces; diff --git a/IBPSA/Electrical/AC/Interfaces/package.order b/IBPSA/Electrical/AC/Interfaces/package.order new file mode 100644 index 0000000000..29b1329317 --- /dev/null +++ b/IBPSA/Electrical/AC/Interfaces/package.order @@ -0,0 +1 @@ +PowerOutput diff --git a/IBPSA/Electrical/AC/OnePhase/Basics/Ground.mo b/IBPSA/Electrical/AC/OnePhase/Basics/Ground.mo new file mode 100644 index 0000000000..77fedcefd9 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Basics/Ground.mo @@ -0,0 +1,37 @@ +within IBPSA.Electrical.AC.OnePhase.Basics; +model Ground "Ground connection" + extends IBPSA.Electrical.Interfaces.Ground( + redeclare package PhaseSystem = PhaseSystems.OnePhase, + redeclare Interfaces.Terminal_n terminal); + annotation ( + defaultComponentName="gnd", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Line( + points={{0,90},{0,0}}, + color={0,120,120}, + smooth=Smooth.None), + Line( + points={{-80,0},{80,0}}, + color={0,120,120}, + smooth=Smooth.None), + Line( + points={{-60,-20},{60,-20}}, + color={0,120,120}, + smooth=Smooth.None), + Line( + points={{-40,-40},{40,-40}}, + color={0,120,120}, + smooth=Smooth.None)}), Documentation(info=" +

+This model represents a connection to the ground. +

+", revisions=" + +")); +end Ground; diff --git a/IBPSA/Electrical/AC/OnePhase/Basics/package.mo b/IBPSA/Electrical/AC/OnePhase/Basics/package.mo new file mode 100644 index 0000000000..aa910693e1 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Basics/package.mo @@ -0,0 +1,18 @@ +within Buildings.Electrical.AC.OnePhase; +package Basics "Package with basic models" +extends Modelica.Icons.BasesPackage; + + +annotation (Documentation(info=" +

+This package contains simple models used in AC single phase networks. +

+", revisions=" + +")); +end Basics; diff --git a/IBPSA/Electrical/AC/OnePhase/Basics/package.order b/IBPSA/Electrical/AC/OnePhase/Basics/package.order new file mode 100644 index 0000000000..4c72fd81ec --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Basics/package.order @@ -0,0 +1 @@ +Ground diff --git a/IBPSA/Electrical/AC/OnePhase/Conversion/ACACConverter.mo b/IBPSA/Electrical/AC/OnePhase/Conversion/ACACConverter.mo new file mode 100644 index 0000000000..b8e3ea2056 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Conversion/ACACConverter.mo @@ -0,0 +1,157 @@ +within IBPSA.Electrical.AC.OnePhase.Conversion; +model ACACConverter "AC AC converter single phase systems" + extends IBPSA.Electrical.Icons.RefAngleConversion; + extends IBPSA.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) + "Ratio of QS rms voltage on side 2 / QS rms voltage on side 1"; + parameter Real eta(min=0, max=1) + "Converter efficiency, pLoss = (1-eta) * Ptr"; + parameter Boolean ground_1 = false + "If true, connect side 1 of converter to ground" + annotation(Evaluate=true,Dialog(tab = "Ground", group="side 1")); + parameter Boolean ground_2 = true + "If true, connect side 2 of converter to ground" + annotation(Evaluate=true, Dialog(tab = "Ground", group="side 2")); + Modelica.Units.SI.Power LossPower[2] "Loss power"; +protected + Modelica.Units.SI.Power P_p[2]=PhaseSystem_p.phasePowers_vi(terminal_p.v, + terminal_p.i) "Power transmitted at pin p"; + Modelica.Units.SI.Power P_n[2]=PhaseSystem_n.phasePowers_vi(terminal_n.v, + terminal_n.i) "Power transmitted at pin n"; +equation + + // Ideal transformation + terminal_p.v = conversionFactor*terminal_n.v; + + // Power loss term + terminal_p.i[1] = terminal_n.i[1]/conversionFactor* + IBPSA.Utilities.Math.Functions.spliceFunction(eta-2, 1/(eta-2), P_p[1], deltax=0.1); + terminal_p.i[2] = terminal_n.i[2]/conversionFactor* + IBPSA.Utilities.Math.Functions.spliceFunction(eta-2, 1/(eta-2), P_p[1], deltax=0.1); + LossPower = P_p + P_n; + + // The two sides have the same reference angle + 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; + + annotation ( + defaultComponentName="conACAC", + Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-100,-100},{100,100}}), + graphics={ + Line( + points={{2,60},{2,60},{82,60},{2,60},{82,-60},{2,-60},{2,60},{2,-60}}, + color={0,120,120}, + smooth=Smooth.None), + Line( + points={{-2,60},{-2,60},{-82,60},{-2,60},{-82,-60},{-2,-60},{-2,60},{ + -2,-60}}, + color={11,193,87}, + smooth=Smooth.None), + Text( + extent={{-100,92},{100,60}}, + textColor={0,0,0}, + textString="%name"), + Text( + extent={{-100,-60},{100,-92}}, + textColor={0,0,0}, + textString="%conversionFactor"), + Text( + extent={{-100,-100},{100,-132}}, + textColor={0,120,120}, + textString="%eta"), + Text( + extent={{-132,78},{-72,38}}, + textColor={11,193,87}, + textString="1"), + Text( + extent={{-88,52},{-28,12}}, + textColor={11,193,87}, + textString="AC"), + Text( + extent={{32,52},{92,12}}, + textColor={0,120,120}, + textString="AC"), + Text( + extent={{70,78},{130,38}}, + textColor={0,120,120}, + textString="2")}), + Documentation(info=" +

+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. +

+", revisions=" + +")); +end ACACConverter; diff --git a/IBPSA/Electrical/AC/OnePhase/Conversion/ACACTransformer.mo b/IBPSA/Electrical/AC/OnePhase/Conversion/ACACTransformer.mo new file mode 100644 index 0000000000..baa0d639a0 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Conversion/ACACTransformer.mo @@ -0,0 +1,294 @@ +within IBPSA.Electrical.AC.OnePhase.Conversion; +model ACACTransformer "AC AC transformer simplified equivalent circuit" + extends IBPSA.Electrical.Icons.RefAngleConversion; + extends IBPSA.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.Units.SI.Voltage VHigh + "Rms voltage on side 1 of the transformer (primary side)"; + parameter Modelica.Units.SI.Voltage VLow + "Rms voltage on side 2 of the transformer (secondary side)"; + parameter Modelica.Units.SI.ApparentPower VABase + "Nominal power of the transformer"; + parameter Real XoverR + "Ratio between the complex and real components of the impedance (XL/R)"; + parameter Real Zperc "Short circuit impedance"; + parameter Boolean ground_1 = false + "If true, connect side 1 of converter to ground" + annotation(Evaluate=true,Dialog(tab = "Ground", group="side 1")); + parameter Boolean ground_2 = true + "If true, connect side 2 of converter to ground" + annotation(Evaluate=true, Dialog(tab = "Ground", group="side 2")); + parameter Modelica.Units.SI.Angle phi_1=0 + "Angle of the voltage side 1 at initialization" + annotation (Evaluate=true, Dialog(tab="Initialization")); + parameter Modelica.Units.SI.Angle phi_2=phi_1 + "Angle of the voltage side 2 at initialization" + annotation (Evaluate=true, Dialog(tab="Initialization")); + Modelica.Units.SI.Efficiency eta "Efficiency"; + Modelica.Units.SI.Power PLoss[2] "Loss power"; + + Modelica.Units.SI.Voltage V1[2](start=PhaseSystem_n.phaseVoltages(VHigh, + phi_1)) "Voltage at the winding - primary side"; + Modelica.Units.SI.Voltage V2[2](start=PhaseSystem_p.phaseVoltages(VLow, phi_2)) + "Voltage at the winding - secondary side"; +protected + Real N = VHigh/VLow "Winding ratio"; + Modelica.Units.SI.Current IHigh=VABase/VHigh + "Nominal current on primary side"; + Modelica.Units.SI.Current ILow=VABase/VLow + "Nominal current on secondary side"; + Modelica.Units.SI.Current IscHigh=IHigh/Zperc + "Short circuit current on primary side"; + Modelica.Units.SI.Current IscLow=ILow/Zperc + "Short circuit current on secondary side"; + Modelica.Units.SI.Impedance Zp=VHigh/IscHigh + "Impedance of the primary side (module)"; + Modelica.Units.SI.Impedance Z1[2]={Zp*cos(atan(XoverR)),Zp*sin(atan(XoverR))} + "Impedance of the primary side of the transformer"; + Modelica.Units.SI.Impedance Zs=VLow/IscLow + "Impedance of the secondary side (module)"; + Modelica.Units.SI.Impedance Z2[2]={Zs*cos(atan(XoverR)),Zs*sin(atan(XoverR))} + "Impedance of the secondary side of the transformer"; + Modelica.Units.SI.Power P_p[2]=PhaseSystem_p.phasePowers_vi(terminal_p.v, + terminal_p.i) "Power transmitted at pin p (secondary)"; + Modelica.Units.SI.Power P_n[2]=PhaseSystem_n.phasePowers_vi(terminal_n.v, + terminal_n.i) "Power transmitted at pin n (primary)"; + Modelica.Units.SI.Power S_p=Modelica.Fluid.Utilities.regRoot(P_p[1]^2 + P_p[2] + ^2, delta=0.1) "Apparent power at terminal p"; + Modelica.Units.SI.Power S_n=Modelica.Fluid.Utilities.regRoot(P_n[1]^2 + P_n[2] + ^2, delta=0.1) "Apparent power at terminal n"; + +equation + // Efficiency + eta = IBPSA.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); + + // Ideal transformation + V2 = V1/N; + terminal_p.i[1] + terminal_n.i[1]*N = 0; + terminal_p.i[2] + terminal_n.i[2]*N = 0; + + // Losses due to the impedance + terminal_n.v = V1 + IBPSA.Electrical.PhaseSystems.OnePhase.product( + terminal_n.i, Z1); + V2 = terminal_p.v; + + // Loss of power + PLoss = P_p + P_n; + + // The two sides have the same reference angle + 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; + + annotation ( + defaultComponentName="traACAC", + Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-100,-100},{100,100}}), + graphics={ + Text( + extent={{-100,-60},{100,-92}}, + textColor={0,0,0}, + textString="%name"), + Text( + extent={{-130,60},{-70,20}}, + textColor={11,193,87}, + textString="1"), + Text( + extent={{-130,100},{-70,60}}, + textColor={11,193,87}, + textString="AC"), + Text( + extent={{70,100},{130,60}}, + textColor={0,120,120}, + textString="AC"), + Text( + extent={{70,60},{130,20}}, + textColor={0,120,120}, + textString="2"), + Line( + points={{-72,40},{-66,40},{-64,44},{-60,36},{-56,44},{-52,36},{-48,44}, + {-44,36},{-42,40},{-38,40}}, + color={0,127,127}, + smooth=Smooth.None), + Line( + points={{-6.85214e-44,-8.39117e-60},{-60,-7.34764e-15}}, + color={0,127,127}, + origin={-40,40}, + rotation=180), + Ellipse( + extent={{-30,46},{-18,34}}, + lineColor={0,127,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-18,46},{-6,34}}, + lineColor={0,127,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-6,46},{6,34}}, + lineColor={0,127,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-30,40},{6,28}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Line( + points={{20,40},{20,20}}, + color={0,127,127}, + smooth=Smooth.None), + Ellipse( + extent={{14,20},{26,8}}, + lineColor={0,127,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{14,8},{26,-4}}, + lineColor={0,127,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{14,-4},{26,-16}}, + lineColor={0,127,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{10,20},{20,-16}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Line( + points={{20,-16},{20,-40}}, + color={0,127,127}, + smooth=Smooth.None), + Line( + points={{20,-40},{-70,-40}}, + color={0,127,127}, + smooth=Smooth.None), + Line( + points={{34,40},{34,20}}, + color={0,127,127}, + smooth=Smooth.None), + Ellipse( + extent={{40,20},{28,8}}, + lineColor={0,127,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{40,8},{28,-4}}, + lineColor={0,127,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{40,-4},{28,-16}}, + lineColor={0,127,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{44,20},{34,-16}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Line( + points={{34,-16},{34,-40}}, + color={0,127,127}, + smooth=Smooth.None), + Line( + points={{70,-40},{34,-40}}, + color={0,127,127}, + smooth=Smooth.None), + Line( + points={{70,40},{34,40}}, + color={0,127,127}, + smooth=Smooth.None), + Text( + extent={{-64,60},{-48,48}}, + textColor={0,120,120}, + textString="R"), + Text( + extent={{-20,60},{-4,48}}, + textColor={0,120,120}, + textString="L")}), + Documentation(info=" +

+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 +

+ +

+Given the nominal conditions,the model computes the values of the resistance and the inductance. +

+", revisions=" + +")); +end ACACTransformer; diff --git a/IBPSA/Electrical/AC/OnePhase/Conversion/ACDCConverter.mo b/IBPSA/Electrical/AC/OnePhase/Conversion/ACDCConverter.mo new file mode 100644 index 0000000000..67283a7426 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Conversion/ACDCConverter.mo @@ -0,0 +1,180 @@ +within IBPSA.Electrical.AC.OnePhase.Conversion; +model ACDCConverter "AC DC converter" + extends IBPSA.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) + "Ratio of DC voltage / AC RMS voltage"; + parameter Real eta(min=0, max=1) + "Converter efficiency, pLoss = (1-eta) * Ptr"; + Modelica.Units.SI.Power PLoss "Loss power"; + parameter Boolean ground_AC = false "Connect AC side of converter to ground" annotation(Evaluate=true, Dialog(tab = "Ground", group="AC side")); + parameter Boolean ground_DC = true "Connect DC side of converter to ground" annotation(Evaluate=true, Dialog(tab = "Ground", group="DC side")); +protected + PhaseSystem_p.Current i_dc "DC current"; + PhaseSystem_p.Voltage v_dc "DC voltage"; + Modelica.Units.SI.Power P_p[2]=PhaseSystem_p.phasePowers_vi(terminal_p.v, + terminal_p.i) "Power transmitted at pin p (secondary)"; + Modelica.Units.SI.Power P_n[2](each start=0) = PhaseSystem_n.phasePowers_vi( + terminal_n.v, terminal_n.i) "Power transmitted at pin n (primary)"; +equation + //voltage relation + v_p = v_n*conversionFactor; + + // Power losses + PLoss = (1-eta)* + IBPSA.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; + + annotation ( +defaultComponentName="conACDC", + Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-100,-100},{100,100}}), + graphics={ + Line( + points={{2,60},{2,60},{82,60},{2,60},{82,-60},{2,-60},{2,60},{2,-60}}, + color={0,0,255}, + smooth=Smooth.None), + Text( + extent={{36,54},{96,14}}, + textColor={0,0,255}, + textString="DC"), + Line( + points={{-2,60},{-2,60},{-82,60},{-2,60},{-82,-60},{-2,-60},{-2,60},{ + -2,-60}}, + color={0,120,120}, + smooth=Smooth.None), + Text( + extent={{-100,52},{-40,12}}, + textColor={0,120,120}, + textString="AC"), + Text( + extent={{-100,92},{100,60}}, + textColor={0,0,0}, + textString="%name"), + Text( + extent={{-100,-60},{100,-92}}, + textColor={0,0,0}, + textString="%conversionFactor"), + Text( + extent={{-100,-100},{100,-132}}, + textColor={0,0,0}, + textString="%eta"), + Line(visible = ground_DC == true, + points={{100,-100},{100,-12}}, + color={0,0,255}, + smooth=Smooth.None), + Line(visible = ground_DC == true, + points={{80,-100},{120,-100}}, + color={0,0,255}, + smooth=Smooth.None), + Line(visible = ground_DC == true, + points={{88,-106},{112,-106}}, + color={0,0,255}, + smooth=Smooth.None), + Line(visible = ground_DC == true, + points={{94,-112},{108,-112}}, + color={0,0,255}, + smooth=Smooth.None), + Line(visible = ground_AC == true, + points={{-80,-40},{-120,-40}}, + color={0,120,120}, + smooth=Smooth.None, + thickness=0.5), + Line(visible = ground_AC == true, + points={{-80,-40},{-106,-14}}, + color={0,120,120}, + smooth=Smooth.None, + thickness=0.5), + Line(visible = ground_AC == true, + points={{-102,-16},{-114,-24},{-118,-42}}, + color={0,120,120}, + smooth=Smooth.Bezier)}), + Documentation(info=" +

+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. +

+", revisions=" + +")); +end ACDCConverter; diff --git a/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/ACACConverter.mo b/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/ACACConverter.mo new file mode 100644 index 0000000000..0c2d2cb4db --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/ACACConverter.mo @@ -0,0 +1,68 @@ +within IBPSA.Electrical.AC.OnePhase.Conversion.Examples; +model ACACConverter + "This example illustrates how to use the AC/AC converter model" + extends Modelica.Icons.Example; + IBPSA.Electrical.AC.OnePhase.Conversion.ACACConverter + conACAC(eta=0.9, conversionFactor=60/120) "ACAC transformer" + annotation (Placement(transformation(extent={{-10,0},{10,20}}))); + IBPSA.Electrical.AC.OnePhase.Sources.FixedVoltage sou( + definiteReference=true, + f=60, + V=120) "Voltage source" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + origin={-60,10}))); + IBPSA.Electrical.AC.OnePhase.Loads.Inductive load( + mode=IBPSA.Electrical.Types.Load.VariableZ_P_input, + V_nominal=60) "Load model" + annotation (Placement(transformation(extent={{24,0},{44,20}}))); + Modelica.Blocks.Sources.Ramp ramp( + duration=0.5, + startTime=0.3, + height=2000, + offset=-1000) "Power consumed by the model" + annotation (Placement(transformation(extent={{80,0},{60,20}}))); +equation + connect(sou.terminal, conACAC.terminal_n) annotation (Line( + points={{-50,10},{-10,10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(conACAC.terminal_p, load.terminal) annotation (Line( + points={{10,10},{24,10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(ramp.y, load.Pow) annotation (Line( + points={{59,10},{44,10}}, + color={0,0,127}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-6), +Documentation(info=" +

+This example illustrates the use of a model that converts AC voltage to AC voltage. +The transformer model assumes a linear loss when transmitting the power. +

+", + revisions=" + +"), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/OnePhase/Conversion/Examples/ACACConverter.mos" + "Simulate and plot")); +end ACACConverter; diff --git a/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/ACACTransformer.mo b/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/ACACTransformer.mo new file mode 100644 index 0000000000..ac0bc25ef2 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/ACACTransformer.mo @@ -0,0 +1,115 @@ +within IBPSA.Electrical.AC.OnePhase.Conversion.Examples; +model ACACTransformer + "This example illustrates how to use the AC/AC simplified transformer model" + extends Modelica.Icons.Example; + IBPSA.Electrical.AC.OnePhase.Conversion.ACACTransformer tra_load( + Zperc=0.03, + VABase=4000, + XoverR=8, + VHigh=120, + VLow=60) "Transformer with load" + annotation (Placement(transformation(extent={{-18,40},{2,60}}))); + IBPSA.Electrical.AC.OnePhase.Sources.FixedVoltage sou( + definiteReference=true, + f=60, + V=120) "Voltage source" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + origin={-70,50}))); + IBPSA.Electrical.AC.OnePhase.Loads.Inductive load( + mode=IBPSA.Electrical.Types.Load.VariableZ_P_input, + pf=0.8, + V_nominal=60) "Load model" + annotation (Placement(transformation(extent={{10,40},{30,60}}))); + Modelica.Blocks.Sources.Ramp ramp( + duration=0.5, + startTime=0.3, + offset=0, + height=-4000*0.8) "Load power consumption profile" + annotation (Placement(transformation(extent={{70,40},{50,60}}))); + IBPSA.Electrical.AC.OnePhase.Conversion.ACACTransformer tra_cc( + XoverR=8, + Zperc=0.03, + VABase=4000, + VHigh=120, + VLow=60) "Transformer with short circuit" + annotation (Placement(transformation(extent={{-16,0},{4,20}}))); + IBPSA.Electrical.AC.OnePhase.Loads.Impedance shortCircuit(R=1e-8) + "Short circuit" + annotation (Placement(transformation(extent={{10,0},{30,20}}))); + IBPSA.Electrical.AC.OnePhase.Conversion.ACACTransformer tra_void( + XoverR=8, + Zperc=0.03, + VABase=4000, + VHigh=120, + VLow=60) "Transformer with secondary not connected" + annotation (Placement(transformation(extent={{-16,-30},{4,-10}}))); + IBPSA.Electrical.AC.OnePhase.Sources.FixedVoltage sou1( + definiteReference=true, + f=60, + V=120) "Voltage source for open and short circuit tests" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + origin={-70,10}))); +equation + connect(sou.terminal, tra_load.terminal_n) + annotation (Line( + points={{-60,50},{-18,50}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(tra_load.terminal_p, load.terminal) annotation (Line( + points={{2,50},{10,50}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(ramp.y, load.Pow) annotation (Line( + points={{49,50},{30,50}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(tra_cc.terminal_p, shortCircuit.terminal) annotation (Line( + points={{4,10},{10,10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(sou1.terminal, tra_cc.terminal_n) annotation (Line( + points={{-60,10},{-16,10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(sou1.terminal, tra_void.terminal_n) annotation (Line( + points={{-60,10},{-38,10},{-38,-20},{-16,-20}}, + color={0,120,120}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-6), +Documentation(info=" +

+This example illustrates the use of a the AC/AC transformer model. +The example shows three different configurations: +

+ +", + revisions=" + +"), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/OnePhase/Conversion/Examples/ACACTransformer.mos" + "Simulate and plot")); +end ACACTransformer; diff --git a/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/ACDCConverter.mo b/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/ACDCConverter.mo new file mode 100644 index 0000000000..c343ff94ba --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/ACDCConverter.mo @@ -0,0 +1,84 @@ +within IBPSA.Electrical.AC.OnePhase.Conversion.Examples; +model ACDCConverter + "This example illustrates how to use the AC/DC converter model" + extends Modelica.Icons.Example; + + IBPSA.Electrical.DC.Loads.Resistor res(R=1, V_nominal=60) + "Resistive load" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={50,10}))); + IBPSA.Electrical.AC.OnePhase.Conversion.ACDCConverter conversion( + eta=0.9, + ground_AC=false, + ground_DC=true, + conversionFactor=60/120) "AC/DC transformer" + annotation (Placement(transformation(extent={{-10,0},{10,20}}))); + IBPSA.Electrical.AC.OnePhase.Sources.FixedVoltage sou( + definiteReference=true, + f=60, + V=120) "Voltage source" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + origin={-62,10}))); + IBPSA.Electrical.DC.Loads.Conductor load(mode=IBPSA.Electrical.Types.Load.VariableZ_P_input, + V_nominal=60) "Variable resistive load" + annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={50,-10}))); + Modelica.Blocks.Sources.Ramp pow( + duration=0.5, + startTime=0.2, + offset=-200, + height=5200) "Variable load profile" + annotation (Placement(transformation(extent={{90,-20},{70,0}}))); +equation + connect(sou.terminal, conversion.terminal_n) annotation (Line( + points={{-52,10},{-10,10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(conversion.terminal_p, res.terminal) annotation (Line( + points={{10,10},{40,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(conversion.terminal_p, load.terminal) annotation (Line( + points={{10,10},{30,10},{30,-10},{40,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(pow.y, load.Pow) annotation (Line( + points={{69,-10},{60,-10}}, + color={0,0,127}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-6), +Documentation(info=" +

+This example illustrates the use of a model that converts AC voltage to DC voltage. +The transformer model assumes a linear loss when transmitting the power. +

+", + revisions=" + +"), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/OnePhase/Conversion/Examples/ACDCConverter.mos" + "Simulate and plot")); +end ACDCConverter; diff --git a/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/package.mo b/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/package.mo new file mode 100644 index 0000000000..afd509a360 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/package.mo @@ -0,0 +1,20 @@ +within IBPSA.Electrical.AC.OnePhase.Conversion; +package Examples "Package with example models" + extends Modelica.Icons.ExamplesPackage; + + +annotation (Documentation(info=" +

+This package contains examples for the use of models that can be found in + +IBPSA.Electrical.AC.OnePhase.Conversion. +

+", revisions=" + +")); +end Examples; diff --git a/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/package.order b/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/package.order new file mode 100644 index 0000000000..258cf200f1 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Conversion/Examples/package.order @@ -0,0 +1,3 @@ +ACACConverter +ACACTransformer +ACDCConverter diff --git a/IBPSA/Electrical/AC/OnePhase/Conversion/package.mo b/IBPSA/Electrical/AC/OnePhase/Conversion/package.mo new file mode 100644 index 0000000000..b209eba1ae --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Conversion/package.mo @@ -0,0 +1,18 @@ +within Buildings.Electrical.AC.OnePhase; +package Conversion "Package with models for AC/AC and AC/DC conversion" + extends Modelica.Icons.Package; + + +annotation (Documentation(info=" +

+This package contains models for AC/AC and AC/DC conversion. +

+", revisions=" + +")); +end Conversion; diff --git a/IBPSA/Electrical/AC/OnePhase/Conversion/package.order b/IBPSA/Electrical/AC/OnePhase/Conversion/package.order new file mode 100644 index 0000000000..21cd8259bd --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Conversion/package.order @@ -0,0 +1,4 @@ +ACACConverter +ACACTransformer +ACDCConverter +Examples diff --git a/IBPSA/Electrical/AC/OnePhase/Interfaces/Terminal_n.mo b/IBPSA/Electrical/AC/OnePhase/Interfaces/Terminal_n.mo new file mode 100644 index 0000000000..c2180a2364 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Interfaces/Terminal_n.mo @@ -0,0 +1,39 @@ +within IBPSA.Electrical.AC.OnePhase.Interfaces; +connector Terminal_n "Terminal n for AC one phase systems" + extends IBPSA.Electrical.Interfaces.Terminal( + redeclare replaceable package PhaseSystem = + IBPSA.Electrical.PhaseSystems.OnePhase); + annotation (defaultComponentName = "term_p", + Documentation(info=" +

Electric connector for AC one phase systems.

+"), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ Text( + extent={{-60,60},{60,-60}}, + textColor={255,255,255}, + pattern=LinePattern.None, + textString=""), Polygon( + points={{0,100},{-100,0},{0,-100},{100,0},{0,100}}, + lineColor={0,120,120}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Text( + extent={{-120,120},{100,60}}, + textColor={0,120,120}, + textString="%name"), + Text( + extent={{14,16},{114,-84}}, + textColor={255,255,255}, + pattern=LinePattern.None, + textString=""), Polygon( + points={{-50,50},{-100,0},{-50,-50},{0,0},{-50,50}}, + lineColor={0,120,120}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)})); +end Terminal_n; diff --git a/IBPSA/Electrical/AC/OnePhase/Interfaces/Terminal_p.mo b/IBPSA/Electrical/AC/OnePhase/Interfaces/Terminal_p.mo new file mode 100644 index 0000000000..6d0e6ba4fc --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Interfaces/Terminal_p.mo @@ -0,0 +1,39 @@ +within IBPSA.Electrical.AC.OnePhase.Interfaces; +connector Terminal_p "Terminal p for AC one phase systems" + extends IBPSA.Electrical.Interfaces.Terminal( + redeclare replaceable package PhaseSystem = + IBPSA.Electrical.PhaseSystems.OnePhase); + annotation (defaultComponentName = "term_p", + Documentation(info=" +

Electric connector for AC one phase systems.

+"), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ Text( + extent={{-60,60},{60,-60}}, + textColor={255,255,255}, + pattern=LinePattern.None, + textString=""), Polygon( + points={{0,100},{-100,0},{0,-100},{100,0},{0,100}}, + lineColor={0,120,120}, + fillColor={0,120,120}, + fillPattern=FillPattern.Solid)}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Text( + extent={{-120,120},{100,60}}, + textColor={0,120,120}, + textString="%name"), + Text( + extent={{14,16},{114,-84}}, + textColor={255,255,255}, + pattern=LinePattern.None, + textString=""), Polygon( + points={{50,50},{0,0},{50,-50},{100,0},{50,50}}, + lineColor={0,120,120}, + fillColor={0,120,120}, + fillPattern=FillPattern.Solid)})); +end Terminal_p; diff --git a/IBPSA/Electrical/AC/OnePhase/Interfaces/package.mo b/IBPSA/Electrical/AC/OnePhase/Interfaces/package.mo new file mode 100644 index 0000000000..9660e8a7ad --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Interfaces/package.mo @@ -0,0 +1,22 @@ +within Buildings.Electrical.AC.OnePhase; +package Interfaces "Package with interfaces for one phase AC systems" + extends Modelica.Icons.InterfacesPackage; + + + annotation (Documentation(info=" +

+This package contains connectors that are used by the models in the +Buildings.Electrical.AC.OnePhase package. +The connectors extend the basic connectors +Buildings.Electrical.Interfaces.Terminal +and define a new graphical icon in order to be distinguished by connectors of other electrical systems (e.g. DC systems). +

+", revisions=" + +")); +end Interfaces; diff --git a/IBPSA/Electrical/AC/OnePhase/Interfaces/package.order b/IBPSA/Electrical/AC/OnePhase/Interfaces/package.order new file mode 100644 index 0000000000..d23ecfc486 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Interfaces/package.order @@ -0,0 +1,2 @@ +Terminal_n +Terminal_p diff --git a/IBPSA/Electrical/AC/OnePhase/Loads/Capacitive.mo b/IBPSA/Electrical/AC/OnePhase/Loads/Capacitive.mo new file mode 100644 index 0000000000..f5860c5292 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Loads/Capacitive.mo @@ -0,0 +1,229 @@ +within IBPSA.Electrical.AC.OnePhase.Loads; +model Capacitive "Model of a capacitive and resistive load" + extends IBPSA.Electrical.Interfaces.CapacitiveLoad( + redeclare package PhaseSystem = PhaseSystems.OnePhase, + redeclare replaceable Interfaces.Terminal_n terminal, + V_nominal(start = 110)); + +protected + Modelica.Units.SI.Angle theRef "Absolute angle of rotating reference system"; + +initial equation + if mode == IBPSA.Electrical.Types.Load.FixedZ_dynamic then + // q = Y[2]*{V_nominal, 0}/omega; + // Steady state initialization + der(q) = zeros(PhaseSystem.n); + end if; +equation + theRef = PhaseSystem.thetaRef(terminal.theta); + omega = der(theRef); + + if mode == IBPSA.Electrical.Types.Load.FixedZ_dynamic then + + // Use the dynamic phasorial representation + Y[1] = -(P_nominal/pf)*pf/V_nominal^2; + Y[2] = -(P_nominal/pf)*Modelica.Fluid.Utilities.regRoot(1 - pf^2, delta=0.001)/V_nominal^2; + + // Electric charge + q = Y[2]*{v[1], v[2]}/omega; + + // Dynamics of the system + der(q) + omega*j(q) + Y[1]*v = i; + + else + + // Use the power specified by the parameter or inputs + if linearized then + i[1] = -homotopy(actual= (v[2]*Q + v[1]*P)/(V_nominal^2), simplified= v[1]*Modelica.Constants.eps*1e3); + i[2] = -homotopy(actual= (v[2]*P - v[1]*Q)/(V_nominal^2), simplified= v[2]*Modelica.Constants.eps*1e3); + else + if initMode == IBPSA.Electrical.Types.InitMode.zero_current then + i[1] = -homotopy(actual=(v[2]*Q + v[1]*P)/(v[1]^2 + v[2]^2), simplified=0.0); + i[2] = -homotopy(actual=(v[2]*P - v[1]*Q)/(v[1]^2 + v[2]^2), simplified=0.0); + else + i[1] = -homotopy(actual=(v[2]*Q + v[1]*P)/(v[1]^2 + v[2]^2), simplified=(v[2]*Q + v[1]*P)/(V_nominal^2)); + i[2] = -homotopy(actual=(v[2]*P - v[1]*Q)/(v[1]^2 + v[2]^2), simplified=(v[2]*P - v[1]*Q)/(V_nominal^2)); + end if; + + end if; + + Y = {0, 0}; + q = {0, 0}; + + end if; + + annotation ( + defaultComponentName="loa", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Rectangle( + extent={{-80,40},{80,-40}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{0,28},{0,-28}}, + color={0,0,0}, + origin={48,0}, + rotation=180), + Line( + points={{0,28},{0,-28}}, + color={0,0,0}, + origin={40,0}, + rotation=180), + Line(points={{-42,-5.14335e-15},{10,0}}, + color={0,0,0}, + origin={-2,0}, + rotation=180), + Line(points={{-26,-3.18398e-15},{0,0}}, + color={0,0,0}, + origin={48,0}, + rotation=180), + Line(points={{-10,-1.22461e-15},{10,0}}, + color={0,0,0}, + origin={-82,0}, + rotation=180), + Rectangle( + extent={{-11,30},{11,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-42,1}, + rotation=90), + Text( + extent={{-120,80},{120,40}}, + textColor={0,0,0}, + textString="%name")}), Documentation(info=" + +

+Model of an capacitive load. It may be used to model a bank of capacitors. +

+

+The model computes the complex power vector as +

+S = P + jQ = V ⋅ i* +

+

+where V is the voltage phasor and i* is the complex +conjugate of the current phasor. The voltage and current phasors are shifted +by an angle φ. +

+ +

+The load model takes as input the power consumed by the inductive load and +the power factor pf=cos(φ). The power +can be either fixed using the parameter P_nominal, or +it is possible to specify a variable power using the inputs y or +Pow. + +The power factor can be either specified by the parameter pf +or using the input variable pf_in. + +The different modes can be selected with the parameter +mode and use_pf_in, see +IBPSA.Electrical.Interfaces.Load and + +IBPSA.Electrical.Interfaces.CapacitiveLoad for more information. +

+ +

+Given the active power P and the power factor pf the complex +power Q is computed as +

+ +

+Q = - P tan(arccos(pf)). +

+ +

+The equations of the model can be rewritten as +

+

+i1 = (P V1 + Q V2)/(V12 + V22), +

+

+i2 = (P V2 - Q V1)/(V12 + V22), +

+ +

+where i1, i2, V1, and V2 +are the real and imaginary parts of the current and voltage phasors. +

+

+The nonlinearity of the model is due to the fact that the load consumes the power specified by the variables P +and Q irrespectively of the voltage of the load. +

+

+When multiple loads are connected in a grid through cables that cause voltage drops, +the dimension of the system of nonlinear equations increases linearly with the number of loads. +This nonlinear system of equations introduces challenges during the initialization, +as Newton solvers may diverge if initialized far from a solution, as well during the simulation. +In this situation, the model can be parameterized to use a linear approximation +as discussed in the next section. +

+ +

Linearized model

+

+Given the constraints and the two-dimensional nature of the problem, it is difficult to +find a linearized version of the AC load model. A solution could be to divide the voltage +domain into sectors, and for each sector compute the best linear approximation. +However the selection of the proper approximation depending on the value of the +voltage can generate events that increase the simulation time. For these reasons, the +linearized model assumes a voltage that is equal to the nominal value +

+

+i1 = (P V1 + Q V2)/VRMS2, +

+

+i2 = (P V2 - Q V1)/VRMS2, +

+

+where VRMS is the Root Mean Square voltage os the AC system. +Even though this linearized version of the load model introduces an approximation +error in the current, it satisfies the constraints related to the ratio of the +active and reactive powers. +

+ +

Initialization

+

+The initialization problem can be simplified using the homotopy operator. The homotopy operator +uses two different types of equations to compute the value of a variable: the actual one +and a simplified one. The actual equation is the one used during the normal operation. +During initialization, the simplified equation is first solved and then slowly replaced +with the actual equation to compute the initial values for the nonlinear systems of +equations. The load model uses the homotopy operator, with the linearized model being used +as the simplified equation. This numerical expedient has proven useful when simulating models +with more than ten connected loads. +

+

+The load model has a parameter initMode that can be used to select +the assumption to use during the initialization phase by the homotopy operator. +The choices are between a null current or the linearized model. +

+ + +", + revisions=" + +")); +end Capacitive; diff --git a/IBPSA/Electrical/AC/OnePhase/Loads/Impedance.mo b/IBPSA/Electrical/AC/OnePhase/Loads/Impedance.mo new file mode 100644 index 0000000000..03e2c0abd1 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Loads/Impedance.mo @@ -0,0 +1,91 @@ +within IBPSA.Electrical.AC.OnePhase.Loads; +model Impedance "Model of a generic impedance" + extends IBPSA.Electrical.Interfaces.Impedance( + redeclare replaceable package PhaseSystem = PhaseSystems.OnePhase, + redeclare replaceable Interfaces.Terminal_n terminal); + +protected + Modelica.Units.SI.Angle theRef "Absolute angle of rotating reference system"; + Modelica.Units.SI.AngularVelocity omega + "Frequency of the quasi-stationary sine waves"; + Modelica.Units.SI.Reactance X(start=1) "Complex component of the impedance"; +equation + theRef = PhaseSystem.thetaRef(terminal.theta); + omega = der(theRef); + + if inductive then + X = omega*L_internal; + else + X = -1/(omega*C_internal); + end if; + + terminal.v = {{R_internal,-X}*terminal.i, {X,R_internal}*terminal.i}; + annotation ( + defaultComponentName="imp", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={Rectangle(extent={{-100,100},{100,-100}}, + lineColor={255,255,255}), + Rectangle( + extent={{-80,40},{80,-40}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={0,3.55271e-15}, + rotation=180), + Line(points={{0,0},{12,0}}, color={0,0,0}, + origin={-80,0}, + rotation=180), + Text( + extent={{-120,-40},{120,-80}}, + textColor={0,0,0}, + textString="%name")}), + Documentation(info=" +

+Model of an impedance. This model can be used to represent any type +of resistive, inductive or capacitive load. +

+

+Note that the power consumed by the impedance model will drecrease if its voltage +decreases. +

+

+The model of the impedance is +

+ +

+V = Z i, +

+ +

+where Z = R + j X is the impedance. The value of the resistance R and the +reactance X depend on the type of impedance. Different types of impedances +can be selected using the boolean parameters inductive, use_R_in, +use_L_in, and use_C_in. See + +IBPSA.Electrical.Interfaces.Impedance for more details. +

+", revisions=" + +")); +end Impedance; diff --git a/IBPSA/Electrical/AC/OnePhase/Loads/Inductive.mo b/IBPSA/Electrical/AC/OnePhase/Loads/Inductive.mo new file mode 100644 index 0000000000..40c2f97db2 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Loads/Inductive.mo @@ -0,0 +1,234 @@ +within IBPSA.Electrical.AC.OnePhase.Loads; +model Inductive "Model of an inductive and resistive load" + extends IBPSA.Electrical.Interfaces.InductiveLoad( + redeclare package PhaseSystem = PhaseSystems.OnePhase, + redeclare replaceable Interfaces.Terminal_n terminal, + V_nominal(start = 110)); + +protected + Modelica.Units.SI.Angle theRef "Absolute angle of rotating reference system"; + +initial equation + if mode == IBPSA.Electrical.Types.Load.FixedZ_dynamic then + // psi = Z[2]*{P_nominal/V_nominal, 0}/omega; + // Steady state initialization + der(psi) = zeros(PhaseSystem.n); + end if; +equation + theRef = PhaseSystem.thetaRef(terminal.theta); + omega = der(theRef); + + if mode == IBPSA.Electrical.Types.Load.FixedZ_dynamic then + + // Use the dynamic phasorial representation + Z[1] = -pf*(V_nominal^2)/(P_nominal/pf); + Z[2] = -Modelica.Fluid.Utilities.regRoot(1-pf^2, delta=0.001)*(V_nominal^2)/(P_nominal/pf); + + // Dynamics of the system + der(psi) + omega*j(psi) + Z[1]*i = v; + + // Magnetic flux + psi = Z[2]*{i[1], i[2]}/omega; + + else + + // Use the power specified by the parameter or inputs + if linearized then + i[1] = -homotopy(actual= (v[2]*Q + v[1]*P)/(V_nominal^2), simplified= v[1]*Modelica.Constants.eps*1e3); + i[2] = -homotopy(actual= (v[2]*P - v[1]*Q)/(V_nominal^2), simplified= v[2]*Modelica.Constants.eps*1e3); + else + //PhaseSystem.phasePowers_vi(terminal.v, terminal.i) = PhaseSystem.phasePowers(P, Q); + if initMode == IBPSA.Electrical.Types.InitMode.zero_current then + i[1] = -homotopy(actual = (v[2]*Q + v[1]*P)/(v[1]^2 + v[2]^2), simplified= 0.0); + i[2] = -homotopy(actual = (v[2]*P - v[1]*Q)/(v[1]^2 + v[2]^2), simplified= 0.0); + else + i[1] = -homotopy(actual = (v[2]*Q + v[1]*P)/(v[1]^2 + v[2]^2), simplified= (v[2]*Q + v[1]*P)/(V_nominal^2)); + i[2] = -homotopy(actual = (v[2]*P - v[1]*Q)/(v[1]^2 + v[2]^2), simplified= (v[2]*P - v[1]*Q)/(V_nominal^2)); + end if; + end if; + + Z = {0,0}; + psi = {0,0}; + + end if; + annotation ( + defaultComponentName="loa", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Rectangle( + extent={{-80,40},{80,-40}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,100},{100,-100}}, + lineColor={255,255,255}), + Ellipse(extent={{-10,-10},{10,10}}, + origin={10,0}, + rotation=360), + Ellipse(extent={{40,-10},{60,10}}), + Ellipse(extent={{20,-10},{40,10}}), + Rectangle( + extent={{0,0},{60,-12}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Line(points={{0,0},{12,0}}, color={0,0,0}, + rotation=180), + Line(points={{0,0},{10,1.22461e-15}}, + color={0,0,0}, + origin={70,0}, + rotation=180), + Rectangle( + extent={{-11,30},{11,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-42,1}, + rotation=90), + Line(points={{-10,-1.22461e-15},{10,0}}, + color={0,0,0}, + origin={-82,0}, + rotation=180), + Text( + extent={{-120,80},{120,40}}, + textColor={0,0,0}, + textString="%name")}), Documentation(info=" + +

+Model of an inductive load. It may be used to model an inductive motor. +

+

+The model computes the complex power vector as +

+S = P + jQ = V ⋅ i*, +

+

+where V is the voltage phasor and i* is the complex +conjugate of the current phasor. The voltage and current phasors are shifted +by an angle φ. +

+ +

+The load model takes as input the power consumed by the inductive load and +the power factor pf=cos(φ). The power +can be either fixed using the parameter P_nominal, or +it is possible to specify a variable power using the inputs y or +Pow. + +The power factor can be either specified by the parameter pf +or using the input connector pf_in. + +The different modes can be selected with the parameter +mode and use_pf_in, see +IBPSA.Electrical.Interfaces.Load and + +IBPSA.Electrical.Interfaces.InductiveLoad for more information. +

+ +

+Given the active power P and the power factor pf, the complex +power Q is computed as +

+ +

+Q = P tan(arccos(pf)). +

+ +

+The equations of the model can be rewritten as +

+

+i1 = (P V1 + Q V2)/(V12 + V22), +

+

+i2 = (P V2 - Q V1)/(V12 + V22), +

+ +

+where i1, i2, V1, and V2 +are the real and imaginary parts of the current and voltage phasors. +

+

+The nonlinearity of the model is due to the fact that the load consumes the power specified by the variables P +and Q, irrespectively of the voltage of the load. +

+

+When multiple loads are connected in a grid through cables that cause voltage drops, +the dimension of the system of nonlinear equations increases linearly with the number of loads. +This nonlinear system of equations introduces challenges during the initialization, +as Newton solvers may diverge if initialized far from a solution, as well during the simulation. +In this situation, the model can be parameterized to use a linear approximation +as discussed in the next section. +

+ +

Linearized model

+

+Given the constraints and the two-dimensional nature of the problem, it is difficult to +find a linearized version of the AC load model. A solution could be to divide the voltage +domain into sectors, and for each sector compute the best linear approximation. +However the selection of the proper approximation depending on the value of the +voltage can generate events that increase the simulation time. For these reasons, the +linearized model assumes a voltage that is equal to the nominal value +

+

+i1 = (P V1 + Q V2)/VRMS2, +

+

+i2 = (P V2 - Q V1)/VRMS2, +

+

+where VRMS is the Root Mean Square voltage of the AC system. +Even though this linearized version of the load model introduces an approximation +error in the current, it satisfies the constraints related to the ratio of the +active and reactive powers. +

+ +

Initialization

+

+The initialization problem can be simplified using the homotopy operator. The homotopy operator +uses two different types of equations to compute the value of a variable: the actual one +and a simplified one. The actual equation is the one used during the normal operation. +During initialization, the simplified equation is first solved and then slowly replaced +with the actual equation to compute the initial values for the nonlinear systems of +equations. The load model uses the homotopy operator, with the linearized model being used +as the simplified equation. This numerical expedient has proven useful when simulating models +with more than ten connected loads. +

+

+The load model has a parameter initMode that can be used to select +the assumption to use during the initialization phase by the homotopy operator. +The choices are between a null current or the linearized model. +

+ + +", revisions=" + +")); +end Inductive; diff --git a/IBPSA/Electrical/AC/OnePhase/Loads/Resistive.mo b/IBPSA/Electrical/AC/OnePhase/Loads/Resistive.mo new file mode 100644 index 0000000000..da11f67304 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Loads/Resistive.mo @@ -0,0 +1,188 @@ +within IBPSA.Electrical.AC.OnePhase.Loads; +model Resistive "Model of a resistive load" + extends IBPSA.Electrical.Interfaces.ResistiveLoad( + redeclare package PhaseSystem = PhaseSystems.OnePhase, + redeclare replaceable Interfaces.Terminal_n terminal, + V_nominal(start = 110)); +equation + + if linearized then + i[1] = -homotopy(actual = v[1]*P/V_nominal^2, simplified = v[1]*Modelica.Constants.eps*1e3); + i[2] = -homotopy(actual = v[2]*P/V_nominal^2, simplified = v[2]*Modelica.Constants.eps*1e3); + else + if initMode == IBPSA.Electrical.Types.InitMode.zero_current then + i[1] = -homotopy(actual= v[1]*P/(v[1]^2 + v[2]^2), simplified= 0.0); + i[2] = -homotopy(actual= v[2]*P/(v[1]^2 + v[2]^2), simplified= 0.0); + else + i[1] = -homotopy(actual= v[1]*P/(v[1]^2 + v[2]^2), + simplified= v[1]*P/V_nominal^2); + i[2] = -homotopy(actual= v[2]*P/(v[1]^2 + v[2]^2), + simplified= v[2]*P/V_nominal^2); + end if; + end if; + annotation ( + defaultComponentName="loa", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={Rectangle(extent={{-100,100},{100,-100}}, + lineColor={255,255,255}), + Rectangle( + extent={{-80,40},{80,-40}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={0,3.55271e-15}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{12,1.46953e-15}}, + color={0,0,0}, + origin={-80,0}, + rotation=180), + Text( + extent={{-120,80},{120,40}}, + textColor={0,0,0}, + textString="%name")}), + Documentation(info=" +

+Model of a resistive load. It may be used to model a load that has +a power factor of one. +

+

+The model computes the complex power vector as +

+S = P + jQ = V ⋅ i* +

+

+where V is the voltage phasor and i* is the complex +conjugate of the current phasor. +

+ +

+The load model takes as input the power consumed by the inductive load and +the power factor pf=cos(φ). The power +can be either fixed using the parameter P_nominal, or +it is possible to specify a variable power using the inputs y or +Pow. The different modes can be selected with the parameter +mode, see +IBPSA.Electrical.Interfaces.Load for more information. +

+ +

+The equations of the model can be rewritten as +

+

+i1 = (P V1 + Q V2)/(V12 + V22), +

+

+i2 = (P V2 - Q V1)/(V12 + V22), +

+ +

+where i1, i2, V1, and V2 +are the real and imaginary parts of the current and voltage phasors. +

+ +

+Since the model represents a load with a power factor of one, the complex +power is Q = 0. This leads to the following equations where +there are nonlinear equations that relate the current to the voltage +

+ +

+i1 = P V1/(V12 + V22) +

+

+i2 = P V2/(V12 + V22) +

+ +

+The non-linearity is due to the fact that the load consumes the power specified by the variable P, +irrespectively of the voltage of the load. The figure below shows the relationship +between the real part of the current phasor and the real and imaginary voltages of the load. +

+

+\"image\" +

+ +

+When multiple loads are connected in a grid through cables that cause voltage drops, +the dimension of the system of nonlinear equations increases linearly with the number of loads. +This nonlinear system of equations introduces challenges during the initialization, +as Newton solvers may diverge if initialized far from a solution, as well during the simulation. +In this situation, the model can be parameterized to use a linear approximation +as discussed in the next section. +

+ +

Linearized model

+

+Given the constraints and the two-dimensional nature of the problem, it is difficult to +find a linearized version of the AC load model. A solution could be to divide the voltage +domain into sectors, and for each sector compute the best linear approximation. +However, the selection of the proper approximation depending on the value of the +voltage can generate events that increase the simulation time. For these reasons, the +linearized model assumes a voltage that is equal to the nominal value +

+

+i1 = P V1/VRMS2 +

+

+i2 = P V2/VRMS2 +

+

+where VRMS is the Root Mean Square voltage of the AC system. +Even though this linearized version of the load model introduces an approximation +error in the current, it satisfies the constraints related to the ratio of the +active and reactive powers. +

+

+The image below show the linearized function +

+

+\"image\" +

+ +

Initialization

+

+The initialization problem can be simplified using the homotopy operator. The homotopy operator +uses two different types of equations to compute the value of a variable: the actual one + and a simplified one. The actual equation is the one used during the normal operation. +During initialization, the simplified equation is first solved and then slowly replaced +with the actual equation to compute the initial values for the nonlinear system of +equations. The load model uses the homotopy operator, with the linearized model being used +as the simplified equation. This numerical expedient has proven useful when simulating models +with more than ten connected loads. +

+

+The load model has a parameter initMode that can be used to select +the assumption to use during the initialization phase by the homotopy operator. +The choices are between a null current or the linearized model. +

+ +", revisions=" + +")); +end Resistive; diff --git a/IBPSA/Electrical/AC/OnePhase/Loads/package.mo b/IBPSA/Electrical/AC/OnePhase/Loads/package.mo new file mode 100644 index 0000000000..120aa1eb44 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Loads/package.mo @@ -0,0 +1,22 @@ +within IBPSA.Electrical.AC.OnePhase; +package Loads "Package with load models for one phase AC systems" + extends Modelica.Icons.VariantsPackage; + + + + + + +annotation (Documentation(info=" +

+This package contains models that represent different types of AC single phase loads. +

+", revisions=" + +")); +end Loads; diff --git a/IBPSA/Electrical/AC/OnePhase/Loads/package.order b/IBPSA/Electrical/AC/OnePhase/Loads/package.order new file mode 100644 index 0000000000..cc49334036 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Loads/package.order @@ -0,0 +1,5 @@ +Capacitive +Impedance +Inductive +Resistive + diff --git a/IBPSA/Electrical/AC/OnePhase/Sources/Examples/FixedVoltageSource.mo b/IBPSA/Electrical/AC/OnePhase/Sources/Examples/FixedVoltageSource.mo new file mode 100644 index 0000000000..d62dd91793 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Sources/Examples/FixedVoltageSource.mo @@ -0,0 +1,43 @@ +within IBPSA.Electrical.AC.OnePhase.Sources.Examples; +model FixedVoltageSource + "This example illustrates how using a fixed voltage source" + extends Modelica.Icons.Example; + IBPSA.Electrical.AC.OnePhase.Loads.Inductive RL( + P_nominal=-300, mode=IBPSA.Electrical.Types.Load.FixedZ_steady_state, + V_nominal=120) "Load model" + annotation (Placement(transformation(extent={{20,-10},{40,10}}))); + FixedVoltage grid( + f=60, + V=120, + phiSou=0.34906585039887) "AC one phase electrical grid" + annotation (Placement(transformation(extent={{-40,-10},{-20,10}}))); + Sensors.Probe sen(V_nominal=120) + "Probe that measures the voltage at the load" + annotation (Placement(transformation(extent={{-10,20},{10,40}}))); +equation + connect(grid.terminal, RL.terminal) + annotation (Line( + points={{-20,4.44089e-16},{-20,0},{20,0},{20,5.55112e-16}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(grid.terminal, sen.term) annotation (Line( + points={{-20,6.66134e-16},{0,6.66134e-16},{0,21},{4.44089e-16,21}}, + color={0,120,120}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-6), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/OnePhase/Sources/Examples/FixedVoltageSource.mos" + "Simulate and plot"), + Documentation(revisions=" + +", info=" +

+This example shows how to use a fixed voltage generator model. +

+")); +end FixedVoltageSource; diff --git a/IBPSA/Electrical/AC/OnePhase/Sources/Examples/VariablePowerSource.mo b/IBPSA/Electrical/AC/OnePhase/Sources/Examples/VariablePowerSource.mo new file mode 100644 index 0000000000..b7947ef9a8 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Sources/Examples/VariablePowerSource.mo @@ -0,0 +1,67 @@ +within IBPSA.Electrical.AC.OnePhase.Sources.Examples; +model VariablePowerSource + "This example illustrates how using a variable power source" + extends Modelica.Icons.Example; + IBPSA.Electrical.AC.OnePhase.Sources.Generator generator(phiGen(displayUnit="deg") = 0.26179938779915, f=60) + "AC generator model" + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + Modelica.Blocks.Sources.Sine generation( + offset=200, + startTime=1, + amplitude=100, + f=0.05) "Generated power" + annotation (Placement(transformation(extent={{-92,-10},{-72,10}}))); + IBPSA.Electrical.AC.OnePhase.Loads.Inductive RL(mode=Types.Load.VariableZ_y_input, + P_nominal=-300, + V_nominal=120) "Load model" + annotation (Placement(transformation(extent={{20,-10},{40,10}}))); + IBPSA.Electrical.AC.OnePhase.Sources.Grid grid(f=60, V=120) + "AC one phase electrical grid" + annotation (Placement(transformation(extent={{-20,40},{0,60}}))); + Modelica.Blocks.Sources.Trapezoid load( + rising=2, + width=3, + falling=3, + period=10, + startTime=1, + amplitude=0.8, + offset=0.2) "Power consumption profile" + annotation (Placement(transformation(extent={{80,-10},{60,10}}))); +equation + connect(generation.y, generator.P) annotation (Line( + points={{-71,0},{-50,0}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(generator.terminal, RL.terminal) + annotation (Line( + points={{-30,0},{20,0}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(grid.terminal, RL.terminal) + annotation (Line( + points={{-10,40},{-10,0},{20,0},{20,5.55112e-16}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(load.y, RL.y) + annotation (Line( + points={{59,0},{40,0}}, + color={0,0,127}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-6), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/OnePhase/Sources/Examples/VariablePowerSource.mos" + "Simulate and plot"), + Documentation(revisions=" + +", info=" +

+This example shows how to use a variable generator model. The model has to be used +together with a voltage source generator. +

+")); +end VariablePowerSource; diff --git a/IBPSA/Electrical/AC/OnePhase/Sources/Examples/package.mo b/IBPSA/Electrical/AC/OnePhase/Sources/Examples/package.mo new file mode 100644 index 0000000000..99def7f824 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Sources/Examples/package.mo @@ -0,0 +1,13 @@ +within IBPSA.Electrical.AC.OnePhase.Sources; +package Examples "Package with example models" + extends Modelica.Icons.ExamplesPackage; + + +annotation (Documentation(info=" +

+This package contains examples for the use of models that can be found in + +IBPSA.Electrical.AC.OnePhase.Sources. +

+")); +end Examples; diff --git a/IBPSA/Electrical/AC/OnePhase/Sources/Examples/package.order b/IBPSA/Electrical/AC/OnePhase/Sources/Examples/package.order new file mode 100644 index 0000000000..b36bb891d8 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Sources/Examples/package.order @@ -0,0 +1 @@ +FixedVoltageSource diff --git a/IBPSA/Electrical/AC/OnePhase/Sources/FixedVoltage.mo b/IBPSA/Electrical/AC/OnePhase/Sources/FixedVoltage.mo new file mode 100644 index 0000000000..b359c8bc47 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Sources/FixedVoltage.mo @@ -0,0 +1,82 @@ +within IBPSA.Electrical.AC.OnePhase.Sources; +model FixedVoltage "Fixed single phase AC voltage source" + extends IBPSA.Electrical.Interfaces.Source( + redeclare package PhaseSystem = PhaseSystems.OnePhase, + redeclare replaceable Interfaces.Terminal_p terminal); + parameter Modelica.Units.SI.Frequency f(start=60) "Frequency of the source"; + parameter Modelica.Units.SI.Voltage V(start=110) "RMS voltage of the source"; + parameter Modelica.Units.SI.Angle phiSou=0 "Phase shift of the source"; +protected + Modelica.Units.SI.Angle thetaRel + "Absolute angle of rotating system as offset to thetaRef"; +equation + if Connections.isRoot(terminal.theta) then + PhaseSystem.thetaRef(terminal.theta) = 2*Modelica.Constants.pi*f*time; + end if; + thetaRel = PhaseSystem.thetaRel(terminal.theta); + terminal.v = PhaseSystem.phaseVoltages(V, thetaRel + phiSou); + + annotation ( + defaultComponentName="fixVol", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), + graphics={ + Ellipse( + extent={{-60,60},{60,-60}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Line( + points={{-44,0},{-24,40},{-4,0},{16,-40},{36,0}}, + color={0,0,0}, + smooth=Smooth.Bezier), + Text( + extent={{-120,100},{120,60}}, + textColor={0,0,0}, + textString="%name"), + Line( + points={{60,0},{90,0}}, + color={0,0,0}, + smooth=Smooth.None), + Line(visible = definiteReference == true, + points={{80,-46},{120,-46}}, + color={0,120,120}, + smooth=Smooth.None, + thickness=0.5), + Line(visible = definiteReference == true, + points={{80,-46},{106,-20}}, + color={0,120,120}, + smooth=Smooth.None, + thickness=0.5), + Line(visible = definiteReference == true, + points={{102,-22},{114,-30},{118,-48}}, + color={0,120,120}, + smooth=Smooth.Bezier), + Text( + extent={{-118,-60},{122,-100}}, + textColor={0,0,0}, + textString="V = %V")}), + Documentation(info=" +

+This is a constant voltage source. The complex voltage is specified by the RMS voltage +and the phase shift. +

+", + revisions=" + +")); +end FixedVoltage; diff --git a/IBPSA/Electrical/AC/OnePhase/Sources/Generator.mo b/IBPSA/Electrical/AC/OnePhase/Sources/Generator.mo new file mode 100644 index 0000000000..558f39fd73 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Sources/Generator.mo @@ -0,0 +1,108 @@ +within IBPSA.Electrical.AC.OnePhase.Sources; +model Generator "Model of a generator" + extends IBPSA.Electrical.Interfaces.Source( + redeclare package PhaseSystem = PhaseSystems.OnePhase, + redeclare replaceable Interfaces.Terminal_p terminal); + parameter Modelica.Units.SI.Frequency f(start=60) "Frequency of the source"; + parameter Modelica.Units.SI.Angle phiGen(displayUnit="deg") = 0 + "Phase shift of the source"; + Modelica.Units.SI.Current I "value of current"; + Modelica.Blocks.Interfaces.RealInput P + "Variable power generated by the source" + annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + origin={-100,0}),iconTransformation( + extent={{-20,-20},{20,20}}, + origin={-100,0}))); +protected + Modelica.Units.SI.Angle thetaRel + "Absolute angle of rotating system as offset to thetaRef"; +equation + if Connections.isRoot(terminal.theta) then + PhaseSystem.thetaRef(terminal.theta) = 2*Modelica.Constants.pi*f*time; + end if; + + thetaRel = PhaseSystem.thetaRel(terminal.theta); + + terminal.i = PhaseSystem.phaseCurrents(I, thetaRel+phiGen); + 0 = PhaseSystem.activePower(terminal.v, terminal.i) + P; + + annotation ( + defaultComponentName="gen", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), + graphics={Rectangle(extent={{-100,100},{100,-100}}, + lineColor={255,255,255}), + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-52,48},{-52,-52},{60,-16},{60,12},{-52,48}}, + lineColor={0,0,0}, + smooth=Smooth.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-120,130},{120,100}}, + textColor={0,0,0}, + textString="%name"), + Line(visible = definiteReference == true, + points={{-20,-128},{20,-128}}, + color={0,120,120}, + smooth=Smooth.None, + thickness=0.5), + Line(visible = definiteReference == true, + points={{-20,-128},{6,-102}}, + color={0,120,120}, + smooth=Smooth.None, + thickness=0.5), + Line(visible = definiteReference == true, + points={{2,-104},{14,-112},{18,-130}}, + color={0,120,120}, + smooth=Smooth.Bezier)}), + Documentation(info=" +

+Model of a generator that produces real power +P with a given phase shift phiGen. +

+

+This model must be used with + +IBPSA.Electrical.AC.OnePhase.Sources.Grid +or with a voltage source from the package + +Modelica.Electrical.QuasiStatic.SinglePhase.Sources. +Otherwise, there will be no equation that defines the phase +angle of the voltage. +

+

+The boolean flags potentialReference and +definiteReference allows to select the phase angle of the +generator as reference for the models connected to it. More info about +these flags are available in + +IBPSA.Electrical.AC.UsersGuide. +

+", revisions=" + +")); +end Generator; diff --git a/IBPSA/Electrical/AC/OnePhase/Sources/Grid.mo b/IBPSA/Electrical/AC/OnePhase/Sources/Grid.mo new file mode 100644 index 0000000000..3935e0571e --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Sources/Grid.mo @@ -0,0 +1,158 @@ +within IBPSA.Electrical.AC.OnePhase.Sources; +model Grid "Electrical grid" + + replaceable IBPSA.Electrical.AC.OnePhase.Interfaces.Terminal_p terminal + annotation (Placement(transformation(extent={{-10, + -110},{10,-90}}), iconTransformation(extent={{-10,-110},{10,-90}}))); + parameter Modelica.Units.SI.Frequency f(start=60) "Frequency of the source"; + parameter Modelica.Units.SI.Voltage V(start=110) "RMS voltage of the source"; + parameter Modelica.Units.SI.Angle phiSou=0 "Phase shift angle of the source"; + IBPSA.Electrical.AC.Interfaces.PowerOutput P + "Power consumed from grid if positive, or fed to grid if negative" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + replaceable IBPSA.Electrical.AC.OnePhase.Sources.FixedVoltage sou( + potentialReference=true, + definiteReference=true, + final f=f, + final V=V, + final phiSou=phiSou) "Voltage source" + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + origin={10,0}))); +equation + P.real = -sou.S[1]; + P.apparent = Modelica.Fluid.Utilities.regRoot(sou.S[2]^2 + sou.S[1]^2, delta = 0.01); + P.phi = sou.phi; + P.cosPhi = cos(sou.phi); + connect(sou.terminal, terminal) annotation (Line( + points={{-4.44089e-16,6.66134e-16},{-4.44089e-16,-100},{4.44089e-16,-100}}, + color={0,120,120}, + smooth=Smooth.None)); + annotation ( + defaultComponentName="gri", + Documentation(info=" +

+Model that can be used to represent the electrical grid supply. +

+

+The model has an output connector named P that +contains information about the power supplied by the grid to the network. +The convention is that P.real is positive if real power is +consumed from the grid, and negative if it is fed into the grid. +

+

+The parameter V is the root means square of the voltage. +In US households, this is 120 Volts at 60 Hz, +in Europe it is 230 Volts at 50 Hz. +

+", + revisions=" + +"), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-120,130},{120,100}}, + textColor={0,0,0}, + textString="%name"), + Line( + points={{-60,-32},{-60,-72}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-74,-32},{-44,-32}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-72,-38},{-48,-28},{-28,-16},{-16,-2},{-12,14}}, + color={175,175,175}, + smooth=Smooth.Bezier), + Line( + points={{-46,-38},{-22,-28},{-2,-16},{10,-2},{14,14}}, + color={175,175,175}, + smooth=Smooth.Bezier), + Line( + points={{-72,-32},{-72,-38}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-46,-32},{-46,-38}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-14,20},{16,20}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{0,20},{0,-20}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-12,20},{-12,14}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{14,20},{14,14}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{14,14},{38,24},{58,36},{70,50},{74,66}}, + color={175,175,175}, + smooth=Smooth.Bezier), + Line( + points={{-12,14},{12,24},{32,36},{44,50},{48,66}}, + color={175,175,175}, + smooth=Smooth.Bezier), + Line( + points={{60,72},{60,32}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{46,72},{76,72}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{48,72},{48,66}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{74,72},{74,66}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-100,-76},{-96,-74},{-88,-68},{-76,-54},{-72,-38}}, + color={175,175,175}, + smooth=Smooth.Bezier), + Line( + points={{-100,-88},{-82,-80},{-62,-68},{-50,-54},{-46,-38}}, + color={175,175,175}, + smooth=Smooth.Bezier), + Line( + points={{48,68},{72,78},{92,90},{98,94},{100,96}}, + color={175,175,175}, + smooth=Smooth.Bezier), + Line( + points={{74,68},{84,72},{100,82}}, + color={175,175,175}, + smooth=Smooth.Bezier)})); +end Grid; diff --git a/IBPSA/Electrical/AC/OnePhase/Sources/package.mo b/IBPSA/Electrical/AC/OnePhase/Sources/package.mo new file mode 100644 index 0000000000..f1f7e0b1ce --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Sources/package.mo @@ -0,0 +1,18 @@ +within IBPSA.Electrical.AC.OnePhase; +package Sources "Package with sources models for one phase AC systems" + extends Modelica.Icons.SourcesPackage; + + +annotation (Documentation(info=" +

+This package contains models of AC sources. +

+", revisions=" + +")); +end Sources; diff --git a/IBPSA/Electrical/AC/OnePhase/Sources/package.order b/IBPSA/Electrical/AC/OnePhase/Sources/package.order new file mode 100644 index 0000000000..8bd0726c07 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/Sources/package.order @@ -0,0 +1,3 @@ +FixedVoltage +Generator +Grid \ No newline at end of file diff --git a/IBPSA/Electrical/AC/OnePhase/package.mo b/IBPSA/Electrical/AC/OnePhase/package.mo new file mode 100644 index 0000000000..2323fb3e4c --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/package.mo @@ -0,0 +1,21 @@ +within IBPSA.Electrical.AC; +package OnePhase "One phase AC systems" +extends Modelica.Icons.VariantsPackage; + + +annotation (Documentation(info=" +

+Package with models for alternate current (AC) single phase systems.
+The models contained in this package use the phase system + +IBPSA.Electrical.PhaseSystems.OnePhase and they assume 120 V as nominal RMS voltage. +

+", revisions=" + +")); +end OnePhase; diff --git a/IBPSA/Electrical/AC/OnePhase/package.order b/IBPSA/Electrical/AC/OnePhase/package.order new file mode 100644 index 0000000000..c57beddfb5 --- /dev/null +++ b/IBPSA/Electrical/AC/OnePhase/package.order @@ -0,0 +1,5 @@ +Basics +Conversion +Interfaces +Loads +Sources diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/ACACConverter.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/ACACConverter.mo new file mode 100644 index 0000000000..d4d7b27a1d --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/ACACConverter.mo @@ -0,0 +1,32 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion; +model ACACConverter "AC AC converter three phase balanced systems" + extends IBPSA.Electrical.AC.OnePhase.Conversion.ACACConverter( + redeclare Interfaces.Terminal_n terminal_n, + redeclare Interfaces.Terminal_p terminal_p); + annotation ( + defaultComponentName="conACAC", + Documentation(info=" +

+This model represents a simplified conversion between two AC +three-phase balanced systems. The conversion losses are represented by a +constant efficiency η. +

+

+See model + +IBPSA.Electrical.AC.OnePhase.Conversion.ACACConverter for more +information. +

+", revisions=" + +")); +end ACACConverter; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/ACACTransformer.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/ACACTransformer.mo new file mode 100644 index 0000000000..9633ad6669 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/ACACTransformer.mo @@ -0,0 +1,32 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion; +model ACACTransformer "AC AC transformer three phase balanced systems" + extends IBPSA.Electrical.AC.OnePhase.Conversion.ACACTransformer( + redeclare Interfaces.Terminal_n terminal_n, + redeclare Interfaces.Terminal_p terminal_p); + annotation ( + defaultComponentName="traACAC", + Documentation(info=" +

+Simple transformer model for three-phase +balanced AC systems. The model does not include core and +magnetic losses. +

+

+See model + +IBPSA.Electrical.AC.OnePhase.Conversion.ACACTransformer for more +information. +

+", revisions=" + +")); +end ACACTransformer; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/ACDCConverter.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/ACDCConverter.mo new file mode 100644 index 0000000000..15be27bfd1 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/ACDCConverter.mo @@ -0,0 +1,31 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion; +model ACDCConverter "AC DC converter" + extends IBPSA.Electrical.AC.OnePhase.Conversion.ACDCConverter( + redeclare Interfaces.Terminal_n terminal_n); + + annotation ( +defaultComponentName="conACDC", +Documentation(info=" +

+This model represents a simplified conversion between a three-phase +balanced AC system and a DC systems. +

+

+See model + +IBPSA.Electrical.AC.OnePhase.Conversion.ACDCConverter for more +information. +

+", revisions=" + +")); +end ACDCConverter; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACACConverter.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACACConverter.mo new file mode 100644 index 0000000000..ec90c11af8 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACACConverter.mo @@ -0,0 +1,66 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion.Examples; +model ACACConverter + "This example illustrates how to use the AC/AC converter model" + extends Modelica.Icons.Example; + + IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion.ACACConverter + conACAC(eta=0.9, conversionFactor=120/480) "ACAC transformer" + annotation (Placement(transformation(extent={{-10,0},{10,20}}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou( + definiteReference=true, + f=60, + V=480) "Voltage source" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + origin={-60,10}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Loads.Inductive load( + mode=IBPSA.Electrical.Types.Load.VariableZ_P_input, + V_nominal=120) "Load model" + annotation (Placement(transformation(extent={{24,0},{44,20}}))); + Modelica.Blocks.Sources.Ramp ramp( + duration=0.5, + startTime=0.3, + height=2000, + offset=-1000) "Power consumed by the model" + annotation (Placement(transformation(extent={{80,0},{60,20}}))); +equation + connect(sou.terminal, conACAC.terminal_n) annotation (Line( + points={{-50,10},{-10,10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(conACAC.terminal_p, load.terminal) annotation (Line( + points={{10,10},{24,10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(ramp.y, load.Pow) annotation (Line( + points={{59,10},{44,10}}, + color={0,0,127}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-6), +Documentation(info=" +

+This example illustrates the use of a model that converts AC voltage to AC voltage. +The transformer model assumes a linear loss when transmitting the power. +

+", + revisions=" + +"), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACACConverter.mos" + "Simulate and plot")); +end ACACConverter; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACACTransformer.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACACTransformer.mo new file mode 100644 index 0000000000..e39b441fcd --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACACTransformer.mo @@ -0,0 +1,111 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion.Examples; +model ACACTransformer + "This example illustrates how to use the AC/AC simplified transformer model" + extends Modelica.Icons.Example; + IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion.ACACTransformer tra_load( + Zperc=0.03, + VABase=4000, + XoverR=8, + VHigh=480, + VLow=120) "Transformer with load" + annotation (Placement(transformation(extent={{-18,40},{2,60}}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou( + definiteReference=true, + f=60, + V=480) "Voltage source" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + origin={-70,50}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Loads.Inductive load( + mode=IBPSA.Electrical.Types.Load.VariableZ_P_input, + pf=0.8, + V_nominal=120) "Load model" + annotation (Placement(transformation(extent={{10,40},{30,60}}))); + Modelica.Blocks.Sources.Ramp ramp( + duration=0.5, + startTime=0.3, + offset=0, + height=-4000*0.8) "Load power consumption profile" + annotation (Placement(transformation(extent={{70,40},{50,60}}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion.ACACTransformer tra_cc( + XoverR=8, + Zperc=0.03, + VABase=4000, + VHigh=480, + VLow=120) "Transformer with short circuit" + annotation (Placement(transformation(extent={{-16,0},{4,20}}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Loads.Impedance shortCircuit(R=1e-8) + "Short circuit" + annotation (Placement(transformation(extent={{10,0},{30,20}}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion.ACACTransformer tra_void( + XoverR=8, + Zperc=0.03, + VABase=4000, + VHigh=480, + VLow=120) "Transformer with secondary not connected" + annotation (Placement(transformation(extent={{-16,-30},{4,-10}}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou1( + definiteReference=true, + f=60, + V=480) "Voltage source for open and short circuit tests" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + origin={-70,10}))); +equation + connect(sou.terminal, tra_load.terminal_n) + annotation (Line( + points={{-60,50},{-18,50}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(tra_load.terminal_p, load.terminal) annotation (Line( + points={{2,50},{10,50}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(ramp.y, load.Pow) annotation (Line( + points={{49,50},{30,50}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(tra_cc.terminal_p, shortCircuit.terminal) annotation (Line( + points={{4,10},{10,10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(sou1.terminal, tra_cc.terminal_n) annotation (Line( + points={{-60,10},{-16,10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(sou1.terminal, tra_void.terminal_n) annotation (Line( + points={{-60,10},{-38,10},{-38,-20},{-16,-20}}, + color={0,120,120}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-6), +Documentation(info=" +

+This example illustrates the use of the AC/AC transformer model. +The example shows three different configurations: +

+ +", revisions=" + +"), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACACTransformer.mos" + "Simulate and plot")); +end ACACTransformer; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACDCConverter.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACDCConverter.mo new file mode 100644 index 0000000000..bdb348a215 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACDCConverter.mo @@ -0,0 +1,85 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion.Examples; +model ACDCConverter + "This example illustrates how to use the AC/DC converter model" + extends Modelica.Icons.Example; + IBPSA.Electrical.DC.Loads.Resistor res( + R=1, + V_nominal=120, + i(each start=0)) + "Resistive load" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={50,10}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion.ACDCConverter conversion( + eta=0.9, + ground_AC=false, + ground_DC=true, + conversionFactor=120/480) "AC/DC transformer" + annotation (Placement(transformation(extent={{-10,0},{10,20}}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou( + definiteReference=true, + f=60, + V=480) "Voltage source" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + origin={-62,10}))); + IBPSA.Electrical.DC.Loads.Conductor load( + mode=IBPSA.Electrical.Types.Load.VariableZ_P_input, + V_nominal=120) "Variable resistive load" + annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={50,-10}))); + Modelica.Blocks.Sources.Ramp pow( + duration=0.5, + startTime=0.2, + offset=-200, + height=5200) "Variable load profile" + annotation (Placement(transformation(extent={{90,-20},{70,0}}))); +equation + connect(sou.terminal, conversion.terminal_n) annotation (Line( + points={{-52,10},{-10,10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(conversion.terminal_p, res.terminal) annotation (Line( + points={{10,10},{40,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(conversion.terminal_p, load.terminal) annotation (Line( + points={{10,10},{30,10},{30,-10},{40,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(pow.y, load.Pow) annotation (Line( + points={{69,-10},{60,-10}}, + color={0,0,127}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-6), +Documentation(info=" +

+This example illustrates the use of a model that converts AC voltage to DC voltage. +The transformer model assumes a linear loss when transmitting the power. +

+", + revisions=" + +"), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/ACDCConverter.mos" + "Simulate and plot")); +end ACDCConverter; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/package.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/package.mo new file mode 100644 index 0000000000..86b0f66e1f --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/package.mo @@ -0,0 +1,20 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion; +package Examples "Package with example models" + extends Modelica.Icons.ExamplesPackage; + + + annotation (Documentation(revisions=" + +", info=" +

+This package contains examples for the use of models that can be found in + +IBPSA.Electrical.AC.ThreePhasesBalanced.Conversion. +

+")); +end Examples; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/package.order b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/package.order new file mode 100644 index 0000000000..258cf200f1 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/Examples/package.order @@ -0,0 +1,3 @@ +ACACConverter +ACACTransformer +ACDCConverter diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/package.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/package.mo new file mode 100644 index 0000000000..96d588db92 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/package.mo @@ -0,0 +1,19 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced; +package Conversion "Package with transformers and converter models for three-phase balanced AC systems" + extends Modelica.Icons.Package; + + +annotation (Documentation(info=" +

+This package contains models for three-phase balanced AC/AC +transformers and AC/DC converters. +

+", revisions=" + +")); +end Conversion; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/package.order b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/package.order new file mode 100644 index 0000000000..21cd8259bd --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Conversion/package.order @@ -0,0 +1,4 @@ +ACACConverter +ACACTransformer +ACDCConverter +Examples diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/Terminal_n.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/Terminal_n.mo new file mode 100644 index 0000000000..909406470a --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/Terminal_n.mo @@ -0,0 +1,38 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Interfaces; +connector Terminal_n "AC three-phase balanced terminal ('negative')" + extends IBPSA.Electrical.Interfaces.Terminal( + redeclare replaceable package PhaseSystem = PhaseSystems.OnePhase); + annotation (defaultComponentName = "term_p", + Documentation(info=" +

Electric connector with a vector of negative pins.

+"), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ Text( + extent={{-60,60},{60,-60}}, + textColor={255,255,255}, + pattern=LinePattern.None, + textString=""), Polygon( + points={{-100,100},{-100,-100},{100,-100},{100,100},{-100,100}}, + lineColor={0,120,120}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Text( + extent={{-120,120},{100,60}}, + textColor={0,120,120}, + textString="%name"), + Text( + extent={{14,16},{114,-84}}, + textColor={255,255,255}, + pattern=LinePattern.None, + textString=""), Polygon( + points={{-100,50},{-100,-50},{0,-50},{0,50},{-100,50}}, + lineColor={0,120,120}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)})); +end Terminal_n; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/Terminal_p.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/Terminal_p.mo new file mode 100644 index 0000000000..41aa21973d --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/Terminal_p.mo @@ -0,0 +1,38 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Interfaces; +connector Terminal_p "AC three-phase balanced terminal ('positive')" + extends IBPSA.Electrical.Interfaces.Terminal( + redeclare replaceable package PhaseSystem = PhaseSystems.OnePhase); + annotation (defaultComponentName = "term_p", + Documentation(info=" +

Electric connector with a vector of positive pins.

+"), + Icon(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ Text( + extent={{-60,60},{60,-60}}, + textColor={255,255,255}, + pattern=LinePattern.None, + textString=""), Polygon( + points={{-100,100},{-100,-100},{100,-100},{100,100},{-100,100}}, + lineColor={0,120,120}, + fillColor={0,120,120}, + fillPattern=FillPattern.Solid)}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Text( + extent={{-120,120},{100,60}}, + textColor={0,120,120}, + textString="%name"), + Text( + extent={{14,16},{114,-84}}, + textColor={255,255,255}, + pattern=LinePattern.None, + textString=""), Polygon( + points={{0,50},{0,-50},{100,-50},{100,50},{0,50}}, + lineColor={0,120,120}, + fillColor={0,120,120}, + fillPattern=FillPattern.Solid)})); +end Terminal_p; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/package.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/package.mo new file mode 100644 index 0000000000..5dc1124791 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/package.mo @@ -0,0 +1,22 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced; +package Interfaces "Package interfaces for three-phase balanced AC systems" + extends Modelica.Icons.InterfacesPackage; + + +annotation (Documentation(info=" +

+This package contains connectors that are used by the models in the +IBPSA.Electrical.AC.ThreePhasesBalanced package. +The connectors extends the basic connectors +IBPSA.Electrical.Interfaces.Terminal +and define a new graphical icon in order to be distinguishable from connectors of other electrical systems (e.g. DC systems). +

+", revisions=" + +")); +end Interfaces; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/package.order b/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/package.order new file mode 100644 index 0000000000..d23ecfc486 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Interfaces/package.order @@ -0,0 +1,2 @@ +Terminal_n +Terminal_p diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Capacitive.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Capacitive.mo new file mode 100644 index 0000000000..0ffa1e080c --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Capacitive.mo @@ -0,0 +1,129 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Loads; +model Capacitive "Model of a capacitive and resistive load" + extends IBPSA.Electrical.AC.OnePhase.Loads.Capacitive( + redeclare Interfaces.Terminal_n terminal, + V_nominal(start=480)); + annotation ( + defaultComponentName="loa", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{-2,-2.44921e-16},{10,0}}, + color={0,0,0}, + origin={-82,0}, + rotation=180), + Text( + extent={{-120,120},{120,80}}, + textColor={0,0,0}, + textString="%name"), + Rectangle( + extent={{-11,22},{11,-22}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-44,1}, + rotation=90), + Line( + points={{0,0},{32,3.91873e-15}}, + color={0,0,0}, + origin={10,50}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{44,5.38825e-15}}, + color={0,0,0}, + origin={60,50}, + rotation=180), + Rectangle( + extent={{-11,22},{11,-22}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-44,51}, + rotation=90), + Rectangle( + extent={{-11,22},{11,-22}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-44,-51}, + rotation=90), + Line( + points={{60,50},{76,0},{60,-52}}, + color={0,0,0}, + smooth=Smooth.None), + Line(points={{-6.85214e-44,-8.39117e-60},{10,1.22461e-15}}, + color={0,0,0}, + origin={-66,50}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{10,1.22461e-15}}, + color={0,0,0}, + origin={-66,0}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{10,1.22461e-15}}, + color={0,0,0}, + origin={-66,-52}, + rotation=180), + Line( + points={{10,68},{10,32}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{16,68},{16,32}}, + color={0,0,0}, + smooth=Smooth.None), + Line(points={{-6.85214e-44,-8.39117e-60},{60,7.34764e-15}}, + color={0,0,0}, + origin={76,0}, + rotation=180), + Line( + points={{16,18},{16,-18}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{10,18},{10,-18}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{0,0},{32,3.91873e-15}}, + color={0,0,0}, + origin={10,0}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{44,5.38825e-15}}, + color={0,0,0}, + origin={60,-52}, + rotation=180), + Line( + points={{16,-34},{16,-70}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{10,-34},{10,-70}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{0,0},{32,3.91873e-15}}, + color={0,0,0}, + origin={10,-52}, + rotation=180)}), Documentation(info=" +

+Model of a capacitive load. See + +IBPSA.Electrical.AC.OnePhase.Loads.Capacitive for more information. +

+", + revisions=" + +")); +end Capacitive; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/Impedances.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/Impedances.mo new file mode 100644 index 0000000000..b0f041ece5 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/Impedances.mo @@ -0,0 +1,68 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Loads.Examples; +model Impedances "Example that illustrates the use of the impedance models" + extends Modelica.Icons.Example; + Sources.FixedVoltage sou(f=60, V=480) "Voltage source" + annotation (Placement(transformation(extent={{-80,-20},{-60,0}}))); + Impedance Z1(R=0, + inductive=true, + L=1/(2*Modelica.Constants.pi*60), + star=true) "Impedance purely inductive" + annotation (Placement(transformation(extent={{-20,40},{0,60}}))); + Impedance Z2(R=1, star=true) "Impedance purely resistive" + annotation (Placement(transformation(extent={{-20,10},{0,30}}))); + Impedance Z3(R=0, + inductive=false, + C=1/(2*Modelica.Constants.pi*60), + star=true) "Impedance purely capacitive" + annotation (Placement(transformation(extent={{-20,-20},{0,0}}))); + Impedance Z4( + inductive=false, + R=1, + C=1/(2*Modelica.Constants.pi*60), + star=true) "Impedance capacitive" + annotation (Placement(transformation(extent={{-20,-50},{0,-30}}))); + Impedance Z5( + R=1, + inductive=true, + L=1/(2*Modelica.Constants.pi*60), + star=true) "Impedance inductive" + annotation (Placement(transformation(extent={{-20,-78},{0,-58}}))); +equation + connect(sou.terminal, Z1.terminal) annotation (Line( + points={{-60,-10},{-40,-10},{-40,50},{-20,50}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(sou.terminal, Z2.terminal) annotation (Line( + points={{-60,-10},{-40,-10},{-40,20},{-20,20}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(sou.terminal, Z3.terminal) annotation (Line( + points={{-60,-10},{-20,-10}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(sou.terminal, Z4.terminal) annotation (Line( + points={{-60,-10},{-40,-10},{-40,-40},{-20,-40}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(sou.terminal, Z5.terminal) annotation (Line( + points={{-60,-10},{-40,-10},{-40,-68},{-20,-68}}, + color={0,120,120}, + smooth=Smooth.None)); + annotation (Documentation(revisions=" + +", info=" +

+This model illustrates the use of the impedance models. +The impedances have unitary values such that the RMS value of the voltage and of the current are the same. +

+"), + experiment(Tolerance=1e-6, StopTime=1.0), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/ThreePhasesBalanced/Loads/Examples/Impedances.mos" + "Simulate and plot")); +end Impedances; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/ParallelLoads.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/ParallelLoads.mo new file mode 100644 index 0000000000..1951abbcb8 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/ParallelLoads.mo @@ -0,0 +1,98 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Loads.Examples; +model ParallelLoads "Example that illustrates the use of the load models" + extends Modelica.Icons.Example; + Sources.FixedVoltage E(f=60, V=480) "Voltage source" + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + Resistive R(P_nominal=-2000, V_nominal=480) "Resistive load" + annotation (Placement(transformation(extent={{-20,40},{0,60}}))); + Inductive RL_pf( + pf=0.8, + P_nominal=-2000, + use_pf_in=true, + V_nominal=480) "Inductive load with variable power factor" + annotation (Placement(transformation(extent={{-20,-10},{0,10}}))); + Modelica.Blocks.Sources.Ramp load( startTime=0.2, duration=0.3) + "Power signal profile" + annotation (Placement(transformation(extent={{60,-50},{40,-30}}))); + Inductive varRL_y( P_nominal=-2000, + V_nominal=480, + mode=IBPSA.Electrical.Types.Load.VariableZ_y_input) + "Inductive load with y as input" + annotation (Placement(transformation(extent={{-20,-36},{0,-16}}))); + Capacitive varRC_y( P_nominal=-2000, + V_nominal=480, + mode=IBPSA.Electrical.Types.Load.VariableZ_y_input) + "Capacitive load with y as input" + annotation (Placement(transformation(extent={{-20,-60},{0,-40}}))); + Inductive varRL_P(pf=0.8, + V_nominal=480, + mode=IBPSA.Electrical.Types.Load.VariableZ_P_input) + "Inductive load with P as input" + annotation (Placement(transformation(extent={{-20,14},{0,34}}))); + Modelica.Blocks.Sources.Ramp pow( + startTime=0.2, + duration=0.3, + height=4000, + offset=-2000) "Power consumption profile" + annotation (Placement(transformation(extent={{60,14},{40,34}}))); + Modelica.Blocks.Sources.Ramp pf( + height=0.2, + duration=0.2, + offset=0.8, + startTime=0.7) "Power factor profile" + annotation (Placement(transformation(extent={{60,-20},{40,0}}))); +equation + connect(E.terminal, R.terminal) annotation (Line( + points={{-60,4.44089e-16},{-40,4.44089e-16},{-40,50},{-20,50}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(E.terminal, RL_pf.terminal) annotation (Line( + points={{-60,4.44089e-16},{-40,4.44089e-16},{-40,0},{-20,0}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(E.terminal, varRL_y.terminal) annotation (Line( + points={{-60,4.44089e-16},{-40,4.44089e-16},{-40,-26},{-20,-26}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(E.terminal, varRC_y.terminal) annotation (Line( + points={{-60,4.44089e-16},{-40,4.44089e-16},{-40,-50},{-20,-50}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(load.y, varRL_y.y) annotation (Line( + points={{39,-40},{20,-40},{20,-26},{4.44089e-16,-26}}, + color={0,0,127}, + smooth=Smooth.None)); + + connect(load.y, varRC_y.y) annotation (Line( + points={{39,-40},{20,-40},{20,-50},{4.44089e-16,-50}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(E.terminal, varRL_P.terminal) annotation (Line( + points={{-60,4.44089e-16},{-40,4.44089e-16},{-40,24},{-20,24}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(pow.y, varRL_P.Pow) annotation (Line( + points={{39,24},{4.44089e-16,24}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(pf.y, RL_pf.pf_in) annotation (Line( + points={{39,-10},{30,-10},{30,6},{4.44089e-16,6}}, + color={0,0,127}, + smooth=Smooth.None)); + annotation ( Documentation(revisions=" + +", info=" +

+This model illustrates the use of the three-phase unbalanced load models. +

+"), + experiment(Tolerance=1e-6, StopTime=1.0), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/ThreePhasesBalanced/Loads/Examples/ParallelLoads.mos" + "Simulate and plot")); +end ParallelLoads; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/package.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/package.mo new file mode 100644 index 0000000000..fd2e1ef444 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/package.mo @@ -0,0 +1,20 @@ +within Buildings.Electrical.AC.ThreePhasesBalanced.Loads; +package Examples "Package with example models" + extends Modelica.Icons.ExamplesPackage; + + + annotation (Documentation(revisions=" + +", info=" +

+This package contains examples for the use of models that can be found in + +Buildings.Electrical.AC.ThreePhasesBalanced.Loads. +

+")); +end Examples; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/package.order b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/package.order new file mode 100644 index 0000000000..72bc095c01 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Examples/package.order @@ -0,0 +1,2 @@ +Impedances +ParallelLoads diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Impedance.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Impedance.mo new file mode 100644 index 0000000000..cdef976646 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Impedance.mo @@ -0,0 +1,161 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Loads; +model Impedance "Model of a resistive load" + extends IBPSA.Electrical.Interfaces.Impedance( + redeclare package PhaseSystem = PhaseSystems.OnePhase, + redeclare Interfaces.Terminal_n terminal); + + parameter Boolean star = true + "Type of load connection: true = star, false = triangle" annotation(Evaluate=true, choices( + choice=true "Star", + choice=false "Triangle", + __Dymola_radioButtons=true)); + +protected + Modelica.Units.SI.Angle theRef "Absolute angle of rotating reference system"; + Modelica.Units.SI.AngularVelocity omega + "Frequency of the quasi-stationary sine waves"; + Modelica.Units.SI.Reactance X(start=1) "Complex component of the impedance"; + +equation + theRef = PhaseSystem.thetaRef(terminal.theta); + omega = der(theRef); + + // Inductance of each line + if inductive then + X = omega*L_internal; + else + X = -1/(omega*C_internal); + end if; + + // Ohm's law + if star then + terminal.v = {{R_internal,-X}*terminal.i, {X,R_internal}*terminal.i}; + else + terminal.v = {{R_internal/3,-X/3}*terminal.i, {X/3,R_internal/3}*terminal.i}; + end if; + annotation ( + defaultComponentName="loa", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={Rectangle(extent={{-100,100},{100,-100}}, + lineColor={255,255,255}), + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={7.10543e-15,7.10543e-15}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{12,1.46953e-15}}, + color={0,0,0}, + origin={-80,0}, + rotation=180), + Text( + extent={{-120,-80},{120,-120}}, + textColor={0,0,0}, + textString="%name"), + Rectangle( + extent={{-11,30},{11,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={2,49}, + rotation=90), + Rectangle( + extent={{-11,30},{11,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={2,1}, + rotation=90), + Rectangle( + extent={{-11,30},{11,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={2,-49}, + rotation=90), + Line( + visible=star == true, + points={{52,50},{68,0},{52,-50}}, + color={0,0,0}, + smooth=Smooth.None), + Line(visible = star == true, + points={{68,0},{52,0}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-68,50},{-28,50}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-68,0},{-28,0}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-68,-50},{-28,-50}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{32,50},{52,50}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{32,0},{52,0}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{32,-50},{52,-50}}, + color={0,0,0}, + smooth=Smooth.None), + Line(visible = star == false, + points={{52,50},{52,36},{-50,14},{-50,0}}, + color={0,0,0}, + smooth=Smooth.None), + Line(visible = star == false, + points={{52,0},{52,-14},{-50,-36},{-50,-50}}, + color={0,0,0}, + smooth=Smooth.None), + Line(visible = star == false, + points={{52,-50},{72,-50},{72,68},{-50,68},{-50,50}}, + color={0,0,0}, + smooth=Smooth.None)}), + Documentation(info=" +

+Model of a three-phase balanced impedance. +

+

+If inductive=true, then the +inductance is a parameter, otherwise +the capacitance is a parameter. +

+

+The boolean parameter star is used to +select whether the star (Y) or triangle (D) +configuration is used to connect the impedance. +By default, the impedance is assumed to be connected +with a star configuration. +

+

+When the connection type changes from +star to triangle, the value of the impedance +is recomputed in such a way that the nominal power consumed by the impedance +does not change. +

+", revisions=" + +")); +end Impedance; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Inductive.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Inductive.mo new file mode 100644 index 0000000000..a791a0a73c --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Inductive.mo @@ -0,0 +1,133 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Loads; +model Inductive "Model of an inductive and resistive load" + extends IBPSA.Electrical.AC.OnePhase.Loads.Inductive( + redeclare Interfaces.Terminal_n terminal, + V_nominal(start=480)); + annotation ( + defaultComponentName="loa", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), + graphics={ + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle(extent={{-100,100},{100,-100}}, + lineColor={255,255,255}), + Ellipse(extent={{-10,-10},{10,10}}, + rotation=360), + Ellipse(extent={{30,-10},{50,10}}), + Ellipse(extent={{10,-10},{30,10}}), + Rectangle( + extent={{-10,0},{50,-12}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Line(points={{0,0},{12,1.46953e-15}}, + color={0,0,0}, + origin={-10,0}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{26,3.18398e-15}}, + color={0,0,0}, + origin={76,0}, + rotation=180), + Rectangle( + extent={{-11,22},{11,-22}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-44,1}, + rotation=90), + Line(points={{-2,-2.44921e-16},{10,0}}, + color={0,0,0}, + origin={-82,0}, + rotation=180), + Text( + extent={{-120,120},{120,80}}, + textColor={0,0,0}, + textString="%name"), + Ellipse(extent={{-10,-10},{10,10}}, + origin={0,50}, + rotation=360), + Ellipse(extent={{30,40},{50,60}}), + Ellipse(extent={{10,40},{30,60}}), + Rectangle( + extent={{-10,50},{50,38}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Line(points={{0,0},{12,1.46953e-15}}, + color={0,0,0}, + origin={-10,50}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{10,1.22461e-15}}, + color={0,0,0}, + origin={60,50}, + rotation=180), + Rectangle( + extent={{-11,22},{11,-22}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-44,51}, + rotation=90), + Ellipse(extent={{-10,-10},{10,10}}, + origin={0,-52}, + rotation=360), + Ellipse(extent={{30,-62},{50,-42}}), + Ellipse(extent={{10,-62},{30,-42}}), + Rectangle( + extent={{-10,-52},{50,-64}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Line(points={{0,0},{12,1.46953e-15}}, + color={0,0,0}, + origin={-10,-52}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{10,1.22461e-15}}, + color={0,0,0}, + origin={60,-52}, + rotation=180), + Rectangle( + extent={{-11,22},{11,-22}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={-44,-51}, + rotation=90), + Line( + points={{60,50},{76,0},{60,-52}}, + color={0,0,0}, + smooth=Smooth.None), + Line(points={{-6.85214e-44,-8.39117e-60},{10,1.22461e-15}}, + color={0,0,0}, + origin={-66,50}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{10,1.22461e-15}}, + color={0,0,0}, + origin={-66,0}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{10,1.22461e-15}}, + color={0,0,0}, + origin={-66,-52}, + rotation=180)}), Documentation(info=" +

+Model of an inductive load. See + +IBPSA.Electrical.AC.OnePhase.Loads.Inductive for more information. +

+", revisions=" + +")); +end Inductive; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Resistive.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Resistive.mo new file mode 100644 index 0000000000..6819223e8f --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/Resistive.mo @@ -0,0 +1,93 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Loads; +model Resistive "Model of a resistive load" + extends IBPSA.Electrical.AC.OnePhase.Loads.Resistive( + redeclare Interfaces.Terminal_n terminal, + V_nominal(start=480)); + annotation ( + defaultComponentName="loa", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={Rectangle(extent={{-100,100},{100,-100}}, + lineColor={255,255,255}), + Rectangle( + extent={{-80,80},{80,-80}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={7.10543e-15,7.10543e-15}, + rotation=180), + Line(points={{-6.85214e-44,-8.39117e-60},{12,1.46953e-15}}, + color={0,0,0}, + origin={-80,0}, + rotation=180), + Text( + extent={{-120,120},{120,80}}, + textColor={0,0,0}, + textString="%name"), + Line( + points={{-66,50},{-26,50}}, + color={0,0,0}, + smooth=Smooth.None), + Rectangle( + extent={{-11,30},{11,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={4,49}, + rotation=90), + Line( + points={{34,50},{54,50}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{54,50},{70,0},{54,-50}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{34,0},{70,0}}, + color={0,0,0}, + smooth=Smooth.None), + Rectangle( + extent={{-11,30},{11,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={4,1}, + rotation=90), + Line( + points={{-66,0},{-26,0}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-66,-50},{-26,-50}}, + color={0,0,0}, + smooth=Smooth.None), + Rectangle( + extent={{-11,30},{11,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={4,-49}, + rotation=90), + Line( + points={{34,-50},{54,-50}}, + color={0,0,0}, + smooth=Smooth.None)}), + Documentation(info=" +

+Model of a resistive load. See + +IBPSA.Electrical.AC.OnePhase.Loads.Resistive for more information. +

+", revisions=" + +")); +end Resistive; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/package.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/package.mo new file mode 100644 index 0000000000..34920b265c --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/package.mo @@ -0,0 +1,19 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced; +package Loads "Package with load models for three-phase balanced AC systems" + extends Modelica.Icons.VariantsPackage; + + +annotation (Documentation(info=" +

+This package contains models that represent different types of three +phases balanced AC loads. +

+", revisions=" + +")); +end Loads; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/package.order b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/package.order new file mode 100644 index 0000000000..865b97b429 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Loads/package.order @@ -0,0 +1,5 @@ +Capacitive +Impedance +Inductive +Resistive +Examples diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Examples/VariablePowerSource.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Examples/VariablePowerSource.mo new file mode 100644 index 0000000000..9cb72cbd76 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Examples/VariablePowerSource.mo @@ -0,0 +1,68 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Sources.Examples; +model VariablePowerSource + "This example illustrates how using a variable power source" + extends Modelica.Icons.Example; + IBPSA.Electrical.AC.ThreePhasesBalanced.Sources.Generator generator(f=60, + phiGen=0.26179938779915) "AC generator model" + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + Modelica.Blocks.Sources.Sine generation( + offset=200, + startTime=1, + amplitude=100, + f=0.05) "Generated power" + annotation (Placement(transformation(extent={{-92,-10},{-72,10}}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Loads.Inductive RL(mode=Types.Load.VariableZ_y_input, + P_nominal=-300, + V_nominal=480) "Load model" + annotation (Placement(transformation(extent={{20,-10},{40,10}}))); + IBPSA.Electrical.AC.ThreePhasesBalanced.Sources.Grid grid(f=60, V=480) + "AC one phase electrical grid" + annotation (Placement(transformation(extent={{-20,40},{0,60}}))); + Modelica.Blocks.Sources.Trapezoid load( + rising=2, + width=3, + falling=3, + period=10, + startTime=1, + amplitude=0.8, + offset=0.2) "Power consumption profile" + annotation (Placement(transformation(extent={{80,-10},{60,10}}))); +equation + connect(generation.y, generator.P) annotation (Line( + points={{-71,0},{-50,0}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(generator.terminal, RL.terminal) + annotation (Line( + points={{-30,0},{20,0}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(grid.terminal, RL.terminal) + annotation (Line( + points={{-10,40},{-10,0},{20,0},{20,5.55112e-16}}, + color={0,120,120}, + smooth=Smooth.None)); + connect(load.y, RL.y) + annotation (Line( + points={{59,0},{40,0}}, + color={0,0,127}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-6), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/AC/ThreePhasesBalanced/Sources/Examples/VariablePowerSource.mos" + "Simulate and plot"), + Documentation(revisions=" + +", info=" +

+This example shows how to use a variable generator model. The generator model has to be used +together with a voltage source generator, which is in this example the +grid model. +

+")); +end VariablePowerSource; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Examples/package.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Examples/package.mo new file mode 100644 index 0000000000..9f9c1d0a19 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Examples/package.mo @@ -0,0 +1,20 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Sources; +package Examples "Package with example models" + extends Modelica.Icons.ExamplesPackage; + + + annotation (Documentation(revisions=" + +", info=" +

+This package contains examples for the use of models that can be found in + +IBPSA.Electrical.AC.ThreePhasesBalanced.Sources. +

+")); +end Examples; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Examples/package.order b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Examples/package.order new file mode 100644 index 0000000000..71cd638e22 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Examples/package.order @@ -0,0 +1 @@ +VariablePowerSource diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/FixedVoltage.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/FixedVoltage.mo new file mode 100644 index 0000000000..8976dff9a0 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/FixedVoltage.mo @@ -0,0 +1,31 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Sources; +model FixedVoltage "Fixed three-phase balanced AC voltage source" + extends IBPSA.Electrical.AC.OnePhase.Sources.FixedVoltage( + redeclare Interfaces.Terminal_p terminal, + f(start=60), + V(start=480)); + annotation ( + defaultComponentName="fixVol", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), + graphics={ Line( + points={{-34,0},{-14,40},{6,0},{26,-40},{46,0}}, + color={120,120,120}, + smooth=Smooth.Bezier), Line( + points={{-24,0},{-4,40},{16,0},{36,-40},{56,0}}, + color={215,215,215}, + smooth=Smooth.Bezier)}), + Documentation(info=" +

+This is a constant voltage source, specifying the complex voltage +by the RMS voltage and the phase shift. +

+", revisions=" + +")); +end FixedVoltage; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Generator.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Generator.mo new file mode 100644 index 0000000000..f95f8fe870 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Generator.mo @@ -0,0 +1,29 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Sources; +model Generator "Model of a generator" + extends IBPSA.Electrical.AC.OnePhase.Sources.Generator( + redeclare Interfaces.Terminal_p terminal, + f(start=60)); + annotation ( + defaultComponentName="gen", + Documentation(info=" +

+Model of an inductive generator. +

+

+See +IBPSA.Electrical.AC.OnePhase.Sources.Generator for +more information. +

+", revisions=" + +")); +end Generator; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Grid.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Grid.mo new file mode 100644 index 0000000000..b44c4187d3 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/Grid.mo @@ -0,0 +1,31 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced.Sources; +model Grid "Electrical grid" + extends IBPSA.Electrical.AC.OnePhase.Sources.Grid( + redeclare Interfaces.Terminal_p terminal, + f(start=60), + V(start=480), + redeclare IBPSA.Electrical.AC.ThreePhasesBalanced.Sources.FixedVoltage sou); + + annotation ( + defaultComponentName="gri", + Documentation(info=" +

+Model that can be used to represent the electrical grid supply. +See +IBPSA.Electrical.AC.OnePhase.Sources.Grid for +more information. +

+", + revisions=" + +")); +end Grid; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/package.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/package.mo new file mode 100644 index 0000000000..01bde7471e --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/package.mo @@ -0,0 +1,18 @@ +within IBPSA.Electrical.AC.ThreePhasesBalanced; +package Sources "Package with source models for three-phase balanced AC systems" + extends Modelica.Icons.SourcesPackage; + + +annotation (Documentation(info=" +

+This package contains models for three-phase balanced AC sources. +

+", revisions=" + +")); +end Sources; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/package.order b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/package.order new file mode 100644 index 0000000000..7398239cc6 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/Sources/package.order @@ -0,0 +1,4 @@ +FixedVoltage +Generator +Grid +Examples diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/package.mo b/IBPSA/Electrical/AC/ThreePhasesBalanced/package.mo new file mode 100644 index 0000000000..4cba2b4369 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/package.mo @@ -0,0 +1,26 @@ +within IBPSA.Electrical.AC; +package ThreePhasesBalanced "Three phases balanced AC systems" + extends Modelica.Icons.VariantsPackage; + + +annotation (Documentation(info=" +

+Package with models for alternate current (AC) three phase balanced systems.
+Because the phases are balanced, the models in this +package extend the models of the package + +IBPSA.Electrical.AC.OnePhase. +

+

+The models that are part of this package assume by default 480 V as nominal RMS phase +to phase voltage. This default value can be changed. +

+", revisions=" + +")); +end ThreePhasesBalanced; diff --git a/IBPSA/Electrical/AC/ThreePhasesBalanced/package.order b/IBPSA/Electrical/AC/ThreePhasesBalanced/package.order new file mode 100644 index 0000000000..520e0bd218 --- /dev/null +++ b/IBPSA/Electrical/AC/ThreePhasesBalanced/package.order @@ -0,0 +1,4 @@ +Conversion +Interfaces +Loads +Sources diff --git a/IBPSA/Electrical/AC/package.mo b/IBPSA/Electrical/AC/package.mo new file mode 100644 index 0000000000..6700079d9c --- /dev/null +++ b/IBPSA/Electrical/AC/package.mo @@ -0,0 +1,149 @@ +within IBPSA.Electrical; +package AC "Package for electrical systems in which the frequency is modeled as quasi-stationary" + extends Modelica.Icons.Package; + +package UsersGuide "User's Guide" + extends Modelica.Icons.Information; + + annotation (preferredView="info", +Documentation(info=" +

+The package +IBPSA.Electrical.AC +models alternate current electrical systems. +

+ +

Modeling assumptions

+

+The package IBPSA.Electrical.AC contains +component models for AC systems. The mathematics that describes AC systems is contained in the package +IBPSA.Electrical.PhaseSystems.OnePhase, +in which n = 2 and m = 1. The AC models that are part of the library can use two different assumptions. +

+

+The first assumption is that the frequency is modeled as quasi-stationary, assuming a perfect sine +wave with no higher harmonics. Voltages and currents are considered as sine waves and just their +amplitudes and phase shifts are taken into account during the analysis. +With such an assumption, electric quantities can be represented with a phasor, i.e., a vector +in the complex plane. +

+

+The second assumption is the so-called dynamic phasorial representation. The basic idea of the +dynamic phasorial representation is to account for dynamic variations of the amplitude and +the angle of the phasors. With such an approach, it is possible to analyze faster dynamics +without directly representing all the electromagnetic effects and high-order harmonics +(for more details, see Stankovic Et Al. 1999, and +Stankovic A.M. and Aydin T.). +

+ +

Phasorial representation

+

+Both the quasi-stationary and the dynamic phasors represent electric +quantities such as voltages and currents using phasors. +The phasors are described by complex numbers that internally are represented as a vector +with two components. The vectors can be represented in the so called Argand plane where on the x-axis +are represented Real numbers while on the y-axis imaginary numbers. +

+

+With such a representation the complex voltages, currents, and powers are represented as +

+

+V = VRe + j VIm, +

+

+I = IRe + j IIm, +

+

+S = P + j Q, +

+ +

+The images below shows how the complex power vector S +changes depending on the type of load. +

+ +

+\"image\" +

+ +

+where the subscripts indicates a +

+ + + +

Reference angle for AC systems

+

+The AC connector has an additional vector that represents the +reference angle theta[PhaseSystem.m]. The reference angle is used, for example in the +AC single phase systems to describe the phase angle of the reference voltage. +This extra information in the connector makes it overdetermined +because the number of effort variables is higher than the number of flow variables. +The over-determined connectors are defined and used in such a way that a Modelica tool is able +to remove the superfluous but consistent equations, arriving at a balanced set of equations based on a +graph analysis of the connection structure. The models in the library uses constructs specified +by the Modelica language to handle this situation, as described by Olsson et al. (2008). +

+

+The reference angles are usually defined by the sources (e.g., voltage sources or generators) and +their values need to be propagated to all the components connected to them. +If more than one generator are connected to the same network, the Modelica tool is able to remove the superfluous equations, +arriving at a balanced set of equations based on a graph analysis of the connection structure. +The flags potentialReference and definiteReference are used to help the +Modelica tool during the selection of the reference angle. If definiteReference = true, +then the reference angle of the source has to be used as reference, while if +potentialReference = true, the reference angle is used only if there are no +definite sources defined. +

+

+When a model is set as definite source an icon representing a phase angle is placed close to its +electrical terminal. +

+ + +

References

+

+ +A.M. Stankovic, B.C. Lesieutre, T. Aydin; Modeling and analysis of single-pahse +induction machines with dynamic phasors
+
+IEEE Transactions on Power Systems, 14(1), Feb. 1999, pp. 9-14.
+ +A.M. Stankovic, T. Aydin; Analysis of asymmetrical faults in power systems using +dynamic phasors
+
+IEEE Transactions on Power Systems, 15(3), 2000, pp. 1062-1068 .
+ +Hans Olsson, Martin Otter, Sven Erik Mattson and Hilding Elmqvist.
+
+Balanced Models in Modelica 3.0 for Increased Model Quality.
+Proc. of the 7th Modelica Conference, Bielefeld, Germany, March 2008.
+

+ +")); +end UsersGuide; + + annotation (Icon(graphics={ Line(points={{-92,-10},{-80.7,24.2},{-73.5,43.1},{ + -67.1,56.4},{-61.4,64.6},{-55.8,69.1},{-50.2,69.8},{-44.6,66.6},{-38.9, + 59.7},{-33.3,49.4},{-26.9,34.1},{-18.83,11.2},{-1.9,-40.8},{5.3,-60.2}, + {11.7,-74.2},{17.3,-83.1},{23,-88.4},{28.6,-90},{34.2,-87.6},{39.9, + -81.5},{45.5,-71.9},{51.9,-57.2},{60,-34.8},{68,-10}}, color={0,0, + 0})}), Documentation(info=" +

+Package with models for alternating current (AC) systems. +

+", revisions=" + +")); +end AC; diff --git a/IBPSA/Electrical/AC/package.order b/IBPSA/Electrical/AC/package.order new file mode 100644 index 0000000000..1e7000d41a --- /dev/null +++ b/IBPSA/Electrical/AC/package.order @@ -0,0 +1,4 @@ +UsersGuide +OnePhase +ThreePhasesBalanced +Interfaces diff --git a/IBPSA/Electrical/BaseClasses/PVSystem/PartialPVSystem.mo b/IBPSA/Electrical/BaseClasses/PVSystem/PartialPVSystem.mo index 2b2a67d3d5..b9ad9beea1 100644 --- a/IBPSA/Electrical/BaseClasses/PVSystem/PartialPVSystem.mo +++ b/IBPSA/Electrical/BaseClasses/PVSystem/PartialPVSystem.mo @@ -3,19 +3,7 @@ partial model PartialPVSystem "Base PV model with internal or external MPP track extends IBPSA.Electrical.BaseClasses.PVSystem.BaseClasses.Icons.partialPVIcon; - replaceable model ElectricalModel = - IBPSA.Electrical.BaseClasses.PVSystem.BaseClasses.PartialPVElectrical - "Model with electrical characteristics"; - - replaceable model ThermalModel = - IBPSA.Electrical.BaseClasses.PVSystem.BaseClasses.PartialPVThermal - "Model with thermal characteristics"; - - replaceable model OpticalModel = - IBPSA.Electrical.BaseClasses.PVSystem.BaseClasses.PartialPVOptical - "Model with optical characteristics" - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + //replaceable model IBPSA.Electrical.BaseClasses.PVSystem.BaseClasses.PartialPVOptical PVOptical annotation(choicesAllMatching=true); replaceable parameter IBPSA.Electrical.DataBase.PVSimpleBaseDataDefinition data constrainedby IBPSA.Electrical.DataBase.PVSimpleBaseDataDefinition @@ -94,6 +82,14 @@ partial model PartialPVSystem "Base PV model with internal or external MPP track Modelica.Blocks.Interfaces.RealOutput P_DC "DC Power output" annotation (Placement(transformation(extent={{94,-10},{114,10}}))); + replaceable BaseClasses.PartialPVOptical partialPVOptical + "Model with optical characteristics" + annotation (Placement(transformation(extent={{-36,64},{-24,76}}))); + replaceable BaseClasses.PartialPVThermal partialPVThermal= IBPSA.Electrical.BaseClasses.PVSystem.BaseClasses.PartialPVThermal + annotation (choicesAllMatching=true,Placement(transformation(extent={{-38,4},{-24,16}}))); + + replaceable BaseClasses.PartialPVElectrical partialPVElectrical + annotation (Placement(transformation(extent={{-36,-56},{-24,-44}}))); protected Modelica.Blocks.Interfaces.RealInput MPP_in_internal "Needed to connect to conditional MPP tracking connector"; diff --git a/IBPSA/Electrical/DC/Interfaces/Terminal_n.mo b/IBPSA/Electrical/DC/Interfaces/Terminal_n.mo new file mode 100644 index 0000000000..bcae2e66b3 --- /dev/null +++ b/IBPSA/Electrical/DC/Interfaces/Terminal_n.mo @@ -0,0 +1,13 @@ +within IBPSA.Electrical.DC.Interfaces; +connector Terminal_n "Terminal n for DC electrical systems" + extends IBPSA.Electrical.Interfaces.Terminal( + redeclare package PhaseSystem = + IBPSA.Electrical.PhaseSystems.TwoConductor); + annotation (Icon(graphics={ Polygon( + points={{-120,0},{0,-120},{120,0},{0,120},{-120,0}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), Documentation(info=" +

Electric connector for DC electrical systems.

+")); +end Terminal_n; diff --git a/IBPSA/Electrical/DC/Interfaces/Terminal_p.mo b/IBPSA/Electrical/DC/Interfaces/Terminal_p.mo new file mode 100644 index 0000000000..a7269c1220 --- /dev/null +++ b/IBPSA/Electrical/DC/Interfaces/Terminal_p.mo @@ -0,0 +1,13 @@ +within IBPSA.Electrical.DC.Interfaces; +connector Terminal_p "Terminal p for DC electrical systems" + extends IBPSA.Electrical.Interfaces.Terminal( + redeclare package PhaseSystem = + IBPSA.Electrical.PhaseSystems.TwoConductor); + annotation (Icon(graphics={ Polygon( + points={{-120,0},{0,-120},{120,0},{0,120},{-120,0}}, + lineColor={0,0,255}, + fillColor={0,0,255}, + fillPattern=FillPattern.Solid)}), Documentation(info=" +

Electric connector for DC electrical systems.

+")); +end Terminal_p; diff --git a/IBPSA/Electrical/DC/Interfaces/package.mo b/IBPSA/Electrical/DC/Interfaces/package.mo new file mode 100644 index 0000000000..15af14fefb --- /dev/null +++ b/IBPSA/Electrical/DC/Interfaces/package.mo @@ -0,0 +1,15 @@ +within IBPSA.Electrical.DC; +package Interfaces "Package with interfaces for DC electrical systems" + extends Modelica.Icons.InterfacesPackage; + + +annotation (Documentation(info=" +

+This package contains connectors that are used by the models in the +IBPSA.Electrical.DC package. +The connectors extends the basic connectors +IBPSA.Electrical.Interfaces.Terminal +and define a new graphical icon in order to be distinguished by connectors of other electrical systems (e.g. AC systems). +

+")); +end Interfaces; diff --git a/IBPSA/Electrical/DC/Interfaces/package.order b/IBPSA/Electrical/DC/Interfaces/package.order new file mode 100644 index 0000000000..d23ecfc486 --- /dev/null +++ b/IBPSA/Electrical/DC/Interfaces/package.order @@ -0,0 +1,2 @@ +Terminal_n +Terminal_p diff --git a/IBPSA/Electrical/DC/Lines/Examples/DCLine.mo b/IBPSA/Electrical/DC/Lines/Examples/DCLine.mo new file mode 100644 index 0000000000..d183199dd2 --- /dev/null +++ b/IBPSA/Electrical/DC/Lines/Examples/DCLine.mo @@ -0,0 +1,92 @@ +within IBPSA.Electrical.DC.Lines.Examples; +model DCLine "Example model to test the DC lines" + extends Modelica.Icons.Example; + Line line( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=100) "Transmission line" + annotation (Placement(transformation(extent={{0,0},{20,20}}))); + Sources.ConstantVoltage E(V=50) "Voltage source" + annotation (Placement(transformation(extent={{-80,0},{-60,20}}))); + Line line1( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=100) "Transmission line" + annotation (Placement(transformation(extent={{0,-20},{20,0}}))); + Line line2( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=100) "Transmission line" + annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); + Modelica.Electrical.Analog.Basic.Ground ground + annotation (Placement(transformation(extent={{-90,-20},{-70,0}}))); + Loads.Conductor load1(mode=Types.Load.VariableZ_y_input, + V_nominal=50, + linearized=false, + P_nominal=-50) "Variable load" + annotation (Placement(transformation(extent={{40,0},{60,20}}))); + Loads.Conductor load2( + V_nominal=50, + linearized=false, + P_nominal=-150) "Load" + annotation (Placement(transformation(extent={{40,-20},{60,0}}))); + Loads.Conductor load3( + V_nominal=50, + linearized=false, + P_nominal=-200) "Load" + annotation (Placement(transformation(extent={{40,-40},{60,-20}}))); + Modelica.Blocks.Sources.Ramp varLoad( + height=0.8, + duration=0.5, + offset=0.2, + startTime=0.3) "Load consumption profile" + annotation (Placement(transformation(extent={{96,0},{76,20}}))); +equation + connect(E.terminal, line.terminal_n) annotation (Line( + points={{-60,10},{-4.44089e-16,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(E.terminal, line1.terminal_n) annotation (Line( + points={{-60,10},{-30,10},{-30,-10},{0,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(E.terminal, line2.terminal_n) annotation (Line( + points={{-60,10},{-30,10},{-30,-30},{0,-30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(load1.terminal, line.terminal_p) annotation (Line( + points={{40,10},{20,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line1.terminal_p, load2.terminal) annotation (Line( + points={{20,-10},{40,-10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line2.terminal_p, load3.terminal) annotation (Line( + points={{20,-30},{40,-30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(varLoad.y, load1.y) annotation (Line( + points={{75,10},{60,10}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(E.n, ground.p) annotation (Line( + points={{-80,10},{-80,0}}, + color={0,0,255}, + smooth=Smooth.None)); + annotation (experiment(StopTime=1.0,Tolerance=1e-06), +__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Electrical/DC/Lines/Examples/DCLine.mos" + "Simulate and plot"), + Documentation(info=" +

+This model is a simple test case that show how to use a line model +and parametrize it using a commercial cable. +

+")); +end DCLine; diff --git a/IBPSA/Electrical/DC/Lines/Examples/DCLines.mo b/IBPSA/Electrical/DC/Lines/Examples/DCLines.mo new file mode 100644 index 0000000000..3b4c7e17a6 --- /dev/null +++ b/IBPSA/Electrical/DC/Lines/Examples/DCLines.mo @@ -0,0 +1,427 @@ +within IBPSA.Electrical.DC.Lines.Examples; +model DCLines + "Example model to test the possible combinations between line and load models" + extends Modelica.Icons.Example; + parameter Boolean linearLoads = false + "Flag that selects between linearized or nonlinear load models"; + parameter Real L = 10 "Length of each cable"; + Modelica.Units.SI.Power Sloads=load1.S[1] + load2.S[1] + load3.S[1] + load4.S[ + 1] + load5.S[1] + load6.S[1] + load7.S[1] + load8.S[1] + load9.S[1] + + load10.S[1] "Sum of the power consumed by the loads"; + Line line( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L, + terminal_n(v(each start=0))) "Transmission line" + annotation (Placement(transformation(extent={{-2,70},{18,90}}))); + Sources.ConstantVoltage E(V=50) "Voltage source" + annotation (Placement(transformation(extent={{-90,70},{-70,90}}))); + Line line1( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{-32,70},{-12,90}}))); + + Line line2( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{-34,30},{-14,50}}))); + + Modelica.Electrical.Analog.Basic.Ground ground + annotation (Placement(transformation(extent={{-100,50},{-80,70}}))); + Loads.Conductor load1(mode=Types.Load.VariableZ_y_input, + V_nominal=50, + linearized=linearLoads, + P_nominal=-150) "Load" + annotation (Placement(transformation(extent={{30,70},{50,90}}))); + Loads.Conductor load2( + V_nominal=50, + mode=Types.Load.VariableZ_y_input, + linearized=linearLoads, + P_nominal=-120) "Load" + annotation (Placement(transformation(extent={{30,50},{50,70}}))); + Loads.Conductor load3( + V_nominal=50, + mode=Types.Load.VariableZ_y_input, + linearized=linearLoads, + P_nominal=-200) "Load" + annotation (Placement(transformation(extent={{30,30},{50,50}}))); + Modelica.Blocks.Sources.Trapezoid + varLoad1( + offset=0.4, + amplitude=0.6, + rising=600, + width=1000, + falling=800, + period=3600, + startTime=1800) "Power consumption profile" + annotation (Placement(transformation(extent={{86,30},{66,50}}))); + Loads.Conductor load4( + V_nominal=50, + mode=Types.Load.VariableZ_y_input, + linearized=linearLoads, + P_nominal=-120) "Load" + annotation (Placement(transformation(extent={{30,12},{50,32}}))); + Line line3( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{2,30},{22,50}}))); + + Line line4( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{0,50},{20,70}}))); + + Line line5( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{2,12},{22,32}}))); + + Line line0( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{-64,70},{-44,90}}))); + + Modelica.Blocks.Sources.Trapezoid + varLoad2( + startTime=1800, + amplitude=0.8, + rising=400, + width=1300, + falling=900, + period=4000, + offset=0.1) "Power consumption profile" + annotation (Placement(transformation(extent={{86,70},{66,90}}))); + Line line6( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{-34,-10},{-14,10}}))); + + Loads.Conductor load5( + V_nominal=50, + mode=Types.Load.VariableZ_y_input, + linearized=linearLoads, + P_nominal=-200) "Load" + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + Modelica.Blocks.Sources.Trapezoid + varLoad3( + amplitude=0.7, + rising=660, + width=900, + falling=300, + period=3700, + offset=0.3, + startTime=200) "Power consumption profile" + annotation (Placement(transformation(extent={{86,-10},{66,10}}))); + Loads.Conductor load6( + V_nominal=50, + mode=Types.Load.VariableZ_y_input, + linearized=linearLoads, + P_nominal=-120) "Load" + annotation (Placement(transformation(extent={{30,-28},{50,-8}}))); + Line line7( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{2,-10},{22,10}}))); + + Line line8( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{2,-28},{22,-8}}))); + + Line line9( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{-34,-50},{-14,-30}}))); + + Loads.Conductor load7( + V_nominal=50, + mode=Types.Load.VariableZ_y_input, + linearized=linearLoads, + P_nominal=-200) "Load" + annotation (Placement(transformation(extent={{30,-50},{50,-30}}))); + Modelica.Blocks.Sources.Trapezoid + varLoad4( + rising=600, + width=1000, + falling=800, + period=3600, + amplitude=0.1, + offset=0.8, + startTime=3300) "Power consumption profile" + annotation (Placement(transformation(extent={{86,-50},{66,-30}}))); + Loads.Conductor load8( + V_nominal=50, + mode=Types.Load.VariableZ_y_input, + linearized=linearLoads, + P_nominal=-120) "Load" + annotation (Placement(transformation(extent={{30,-68},{50,-48}}))); + Line line10( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{2,-50},{22,-30}}))); + + Line line11( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{2,-68},{22,-48}}))); + + Line line12( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{-34,-90},{-14,-70}}))); + + Loads.Conductor load9( + V_nominal=50, + mode=Types.Load.VariableZ_y_input, + linearized=linearLoads, + P_nominal=-200) "Load" + annotation (Placement(transformation(extent={{30,-90},{50,-70}}))); + Modelica.Blocks.Sources.Trapezoid + varLoad5( + falling=800, + amplitude=0.5, + rising=800, + width=800, + period=3000, + offset=0.5, + startTime=0) "Power consumption profile" + annotation (Placement(transformation(extent={{86,-90},{66,-70}}))); + Loads.Conductor load10( + V_nominal=50, + mode=Types.Load.VariableZ_y_input, + linearized=linearLoads, + P_nominal=-120) "Load" + annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); + Line line13( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=L) "Transmission line" + annotation (Placement(transformation(extent={{2,-90},{22,-70}}))); + + Line line14( + P_nominal=500, + V_nominal=50, + mode=Types.CableMode.commercial, + commercialCable=Transmission.LowVoltageCables.PvcAl16(), + l=100) "Transmission line" + annotation (Placement(transformation(extent={{2,-108},{22,-88}}))); + +equation + connect(load1.terminal, line.terminal_p) annotation (Line( + points={{30,80},{18,80}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line1.terminal_p, line.terminal_n) annotation (Line( + points={{-12,80},{-2,80}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line2.terminal_p, line3.terminal_n) annotation (Line( + points={{-14,40},{2,40}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line3.terminal_p, load3.terminal) annotation (Line( + points={{22,40},{30,40}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line1.terminal_p, line4.terminal_n) annotation (Line( + points={{-12,80},{-6,80},{-6,60},{0,60}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line4.terminal_p, load2.terminal) annotation (Line( + points={{20,60},{30,60}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(load4.terminal, line5.terminal_p) annotation (Line( + points={{30,22},{22,22}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line5.terminal_n, line3.terminal_n) annotation (Line( + points={{2,22},{-8,22},{-8,40},{2,40}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(E.terminal, line0.terminal_n) annotation (Line( + points={{-70,80},{-64,80}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line0.terminal_p, line1.terminal_n) annotation (Line( + points={{-44,80},{-32,80}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(varLoad1.y, load3.y) annotation (Line( + points={{65,40},{50,40}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(varLoad1.y, load4.y) annotation (Line( + points={{65,40},{58,40},{58,22},{50,22}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(varLoad2.y, load1.y) annotation (Line( + points={{65,80},{50,80}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(varLoad2.y, load2.y) annotation (Line( + points={{65,80},{58,80},{58,60},{50,60}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(line6.terminal_p,line7. terminal_n) annotation (Line( + points={{-14,0},{2,0}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line7.terminal_p,load5. terminal) annotation (Line( + points={{22,0},{30,0}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(load6.terminal,line8. terminal_p) annotation (Line( + points={{30,-18},{22,-18}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line8.terminal_n,line7. terminal_n) annotation (Line( + points={{2,-18},{-8,-18},{-8,0},{2,0}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(varLoad3.y,load5. y) annotation (Line( + points={{65,0},{50,0}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(varLoad3.y,load6. y) annotation (Line( + points={{65,0},{58,0},{58,-18},{50,-18}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(line9.terminal_p, line10.terminal_n) + annotation (Line( + points={{-14,-40},{2,-40}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line10.terminal_p, load7.terminal) + annotation (Line( + points={{22,-40},{30,-40}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(load8.terminal, line11.terminal_p) + annotation (Line( + points={{30,-58},{22,-58}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line11.terminal_n, line10.terminal_n) + annotation (Line( + points={{2,-58},{-8,-58},{-8,-40},{2,-40}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(varLoad4.y,load7. y) annotation (Line( + points={{65,-40},{50,-40}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(varLoad4.y,load8. y) annotation (Line( + points={{65,-40},{58,-40},{58,-58},{50,-58}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(line12.terminal_p, line13.terminal_n) + annotation (Line( + points={{-14,-80},{2,-80}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line13.terminal_p, load9.terminal) + annotation (Line( + points={{22,-80},{30,-80}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(load10.terminal, line14.terminal_p) + annotation (Line( + points={{30,-98},{22,-98}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line14.terminal_n, line13.terminal_n) + annotation (Line( + points={{2,-98},{-8,-98},{-8,-80},{2,-80}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(varLoad5.y,load9. y) annotation (Line( + points={{65,-80},{50,-80}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(varLoad5.y, load10.y) + annotation (Line( + points={{65,-80},{58,-80},{58,-98},{50,-98}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(line2.terminal_n, line4.terminal_n) annotation (Line( + points={{-34,40},{-34,60},{0,60}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line6.terminal_n, line3.terminal_n) annotation (Line( + points={{-34,0},{-34,22},{-8,22},{-8,40},{2,40}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line9.terminal_n, line7.terminal_n) annotation (Line( + points={{-34,-40},{-34,-18},{-8,-18},{-8,0},{2,0},{2,5.55112e-16}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(line12.terminal_n, line10.terminal_n) annotation (Line( + points={{-34,-80},{-34,-58},{-8,-58},{-8,-40},{2,-40}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(E.n, ground.p) annotation (Line( + points={{-90,80},{-90,70}}, + color={0,0,255}, + smooth=Smooth.None)); + annotation (experiment(StopTime=4000,Tolerance=1e-06), +__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Electrical/DC/Lines/Examples/DCLines.mos" + "Simulate and plot"), + Documentation(info=" +

+This model shows a DC grid with 10 loads and 16 cables. +Each cable is of length l = 10 meters, a parameter that can be modified. +Each load can be either be a full nonlinear model, or be replaced by the +linearized version. The parameter linearLoads = false +can be used to switch between linear and nonlinear implementation. +

+

+This model can be used to test how the linearized loads are affected by the voltage drop +caused by the lines. The longer the distance between the load and the source, +the bigger is the voltage drop and thus the error introduced by the linearization. +

+")); +end DCLines; diff --git a/IBPSA/Electrical/DC/Lines/Examples/DCLinesLinearized.mo b/IBPSA/Electrical/DC/Lines/Examples/DCLinesLinearized.mo new file mode 100644 index 0000000000..2126d1b6a4 --- /dev/null +++ b/IBPSA/Electrical/DC/Lines/Examples/DCLinesLinearized.mo @@ -0,0 +1,20 @@ +within IBPSA.Electrical.DC.Lines.Examples; +model DCLinesLinearized + "Example model to test the possible combinations between line and load models" + extends IBPSA.Electrical.DC.Lines.Examples.DCLines(linearLoads = true); + + annotation (Documentation(info=" +

+This model is the linearized version of the model + +IBPSA.Electrical.DC.Lines.Examples.DCLines and +can be used to test how the linearized loads are affected by the voltage drop +caused by the lines. The longer the distance between the load and the source, +the bigger is the voltage drop and thus the error introduced by the linearization. +

+"), +experiment(Tolerance=1e-06, StopTime=4000), +__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Electrical/DC/Lines/Examples/DCLinesLinearized.mos" + "Simulate and plot")); + +end DCLinesLinearized; diff --git a/IBPSA/Electrical/DC/Lines/Examples/package.mo b/IBPSA/Electrical/DC/Lines/Examples/package.mo new file mode 100644 index 0000000000..8f29018ddd --- /dev/null +++ b/IBPSA/Electrical/DC/Lines/Examples/package.mo @@ -0,0 +1,13 @@ +within IBPSA.Electrical.DC.Lines; +package Examples "Package with example models" +extends Modelica.Icons.ExamplesPackage; + + +annotation (Documentation(info=" +

+This package contains examples for the use of models that can be found in + +IBPSA.Electrical.DC.Lines. +

+")); +end Examples; diff --git a/IBPSA/Electrical/DC/Lines/Examples/package.order b/IBPSA/Electrical/DC/Lines/Examples/package.order new file mode 100644 index 0000000000..c5de5a360a --- /dev/null +++ b/IBPSA/Electrical/DC/Lines/Examples/package.order @@ -0,0 +1,3 @@ +DCLine +DCLines +DCLinesLinearized diff --git a/IBPSA/Electrical/DC/Lines/Line.mo b/IBPSA/Electrical/DC/Lines/Line.mo new file mode 100644 index 0000000000..2488c8ae29 --- /dev/null +++ b/IBPSA/Electrical/DC/Lines/Line.mo @@ -0,0 +1,93 @@ +within IBPSA.Electrical.DC.Lines; +model Line "Model of a DC electrical line" + extends IBPSA.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 = IBPSA.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) + annotation (Placement(transformation(extent={{-10,10},{10,-10}}))); +equation + connect(terminal_n, lineRC.terminal_n) annotation (Line( + points={{-100,0},{-10,0}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(lineRC.terminal_p, terminal_p) annotation (Line( + points={{10,0},{100,0}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(cableTemp.port, lineRC.heatPort) annotation (Line( + points={{-40,22},{0,22},{0,10}}, + color={191,0,0}, + smooth=Smooth.None)); + annotation ( Icon(graphics={ + Ellipse( + extent={{-70,10},{-50,-10}}, + lineColor={0,0,0}, + fillColor={96,107,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-60,10},{60,-10}}, + fillColor={96,107,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Ellipse( + extent={{50,10},{70,-10}}, + lineColor={0,0,0}, + fillColor={255,128,0}, + fillPattern=FillPattern.Solid), + Line( + points={{-70,0},{-90,0}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-60,10},{60,10}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-60,-10},{60,-10}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{96,0},{60,0}}, + color={0,0,0}, + smooth=Smooth.None)}), + Documentation(revisions=" + +", info=" +

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

+")); +end Line; diff --git a/IBPSA/Electrical/DC/Lines/TwoPortRCLine.mo b/IBPSA/Electrical/DC/Lines/TwoPortRCLine.mo new file mode 100644 index 0000000000..5d6d5c1ad1 --- /dev/null +++ b/IBPSA/Electrical/DC/Lines/TwoPortRCLine.mo @@ -0,0 +1,98 @@ +within IBPSA.Electrical.DC.Lines; +model TwoPortRCLine "Model of a two port DC resistance and capacity (T-model)" + extends IBPSA.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" + annotation(Dialog(tab="Model", group="Assumptions")); + parameter Modelica.Units.SI.Voltage Vc_start=V_nominal + "Initial value of the voltage of the capacitance in the middle of the line"; + Modelica.Units.SI.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; + + annotation (Diagram(graphics={ + Rectangle(extent={{-70,30},{70,-30}}, lineColor={0,0,255}), + Line(points={{-90,0},{-70,0}}, color={0,0,255}), + Line(points={{70,0},{90,0}}, color={0,0,255})}), Icon( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), + graphics={ + Text( + extent={{-144,97},{156,57}}, + textColor={0,0,0}, + textString="%name"), + Line(points={{-90,0},{-70,0}}, color={0,0,255}), + Line(points={{70,0},{90,0}}, color={0,0,255}), + Rectangle( + extent={{-70,32},{70,-28}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), + Documentation(info=" +

+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. +

+

+\"image\" +

+

+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. +

+", revisions=" + +")); +end TwoPortRCLine; diff --git a/IBPSA/Electrical/DC/Lines/TwoPortResistance.mo b/IBPSA/Electrical/DC/Lines/TwoPortResistance.mo new file mode 100644 index 0000000000..29b206e271 --- /dev/null +++ b/IBPSA/Electrical/DC/Lines/TwoPortResistance.mo @@ -0,0 +1,73 @@ +within IBPSA.Electrical.DC.Lines; +model TwoPortResistance "Model of a two port DC resistance" + extends + IBPSA.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; + + annotation (Diagram(graphics={ + Rectangle(extent={{-70,30},{70,-30}}, lineColor={0,0,255}), + Line(points={{-90,0},{-70,0}}, color={0,0,255}), + Line(points={{70,0},{90,0}}, color={0,0,255})}), Icon( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), + graphics={ + Text( + extent={{-144,97},{156,57}}, + textColor={0,0,0}, + textString="%name"), + Text( + extent={{-142,-30},{144,-62}}, + textColor={0,0,0}, + textString="R=%R"), + Line(points={{-90,0},{-70,0}}, color={0,0,255}), + Line(points={{70,0},{90,0}}, color={0,0,255}), + Rectangle( + extent={{-70,30},{70,-30}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), + Documentation(info=" +

+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. +

+

+\"image\" +

+", revisions=" + +")); +end TwoPortResistance; diff --git a/IBPSA/Electrical/DC/Lines/package.mo b/IBPSA/Electrical/DC/Lines/package.mo new file mode 100644 index 0000000000..b9a660bb24 --- /dev/null +++ b/IBPSA/Electrical/DC/Lines/package.mo @@ -0,0 +1,28 @@ +within IBPSA.Electrical.DC; +package Lines "Package with models for DC electrical lines" + extends Modelica.Icons.Package; + + +annotation (Icon(graphics={ + Ellipse( + extent={{40,8},{16,-28}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{28,8},{-54,8},{-64,8},{-72,-10},{-64,-28},{-52,-28},{28,-28}}, + color={0,0,0}, + smooth=Smooth.Bezier), + Line( + points={{-70,-10},{-88,-10}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{54,-10},{28,-10}}, + color={0,0,0}, + smooth=Smooth.None)}), Documentation(info=" +

+This package contains models for lines for DC circuits. +

+")); +end Lines; diff --git a/IBPSA/Electrical/DC/Lines/package.order b/IBPSA/Electrical/DC/Lines/package.order new file mode 100644 index 0000000000..7f10e753a9 --- /dev/null +++ b/IBPSA/Electrical/DC/Lines/package.order @@ -0,0 +1,4 @@ +Line +TwoPortRCLine +TwoPortResistance +Examples diff --git a/IBPSA/Electrical/DC/Loads/Conductor.mo b/IBPSA/Electrical/DC/Loads/Conductor.mo new file mode 100644 index 0000000000..6dfbf54263 --- /dev/null +++ b/IBPSA/Electrical/DC/Loads/Conductor.mo @@ -0,0 +1,184 @@ +within IBPSA.Electrical.DC.Loads; +model Conductor "Model of a generic DC load" + extends IBPSA.Electrical.Interfaces.ResistiveLoad( + redeclare package PhaseSystem = PhaseSystems.TwoConductor, + redeclare Interfaces.Terminal_n terminal); +protected + Modelica.Units.SI.Voltage absDV + "Absolute value of the voltage difference between the two conductors (used by the linearized model)"; +equation + + absDV = abs(terminal.v[1]-terminal.v[2]); + + if linearized then + + // Linearized version of the model + if absDV <= (8/9)*V_nominal then + terminal.i[1] + P*(2/(0.8*V_nominal) - (terminal.v[1]-terminal.v[2])/(0.8*V_nominal)^2) = 0; + elseif absDV >= (12/11)*V_nominal then + terminal.i[1] + P*(2/(1.2*V_nominal) - (terminal.v[1]-terminal.v[2])/(1.2*V_nominal)^2) = 0; + else + terminal.i[1] + P*(2/V_nominal - (terminal.v[1]-terminal.v[2])/V_nominal^2) = 0; + end if; + + else + // Full nonlinear version of the model + // PhaseSystem.activePower(terminal.v, terminal.i) + P = 0; + if initMode == IBPSA.Electrical.Types.InitMode.zero_current then + i[1] = - homotopy(actual= P/(v[1] - v[2]), simplified= 0); + else + i[1] = - homotopy(actual= P/(v[1] - v[2]), simplified= P*(2/V_nominal - (v[1]-v[2])/V_nominal^2)); + end if; + + end if; + + // Since the connector is a two conductor, the sum of the currents at the terminal + // is null + sum(i) = 0; + annotation ( + Documentation(info=" +

+Model of a generic DC load. The load can be either constant or variable depending on the value of the +parameter mode. +See the model IBPSA.Electrical.Interfaces.Load +for more information. +

+ +

+The model computes the current drawn from the load as +

+

+P = V i, +

+

+where P is the power, V is the voltage and i is the current.
+If the component consumes power, then P < 0. +If it feeds power into the electrical grid, then P > 0. +

+ +

Linearization

+

+Consider the simple DC circuit shown in the figure below +

+

+\"image\" +

+

+where VS is a constant voltage source, and R is the line resistance. +The load has a voltage V across its electrical pins and a current i is flowing through it. +If the power consumption drawn by the load is prescribed by the variable PLOAD, + the equation that describes the circuit is +

+

+VS - R i - PLOAD/i = 0 +

+

+The unknown variable i appears in a nonlinear equation. This means that in order to compute the current +that is drawn by the load, a nonlinear equation has to be solved. If the number of loads increases (as typically +happens in real case examples) the number of nonlinear equations to be solved increases too, and the resulting system +of nonlinear equations can slow down the simulation. It is possible to avoid such a problem by introducing a linearized +model. +

+ +

+The first step to linearize the load model is to define its nominal voltage conditions Vnom, +around which the equations will be linearized.
+The constitutive equation of the load can be linearized around the nominal voltage condition Vnom as +

+ +

+i = PLOAD/V = PLOAD/Vnom + +(V - Vnom)[∂ (PLOAD/V)/ ∂V ]V = Vnom ++ ₒ((V - Vnom)2), +

+ +

+which leads to the linearized formulation +

+ +

+i ≃ PLOAD (2/Vnom - V/Vnom2). +

+ +

+The linearized formulation approximates the load power consumption (or production), +with the approximation error being proportional to (V - Vnom)2. +A further approximation has been introduced to improve the +approximation of the linearized model even if the voltage is far from the nominal condition. +This piecewise linearized approximation instead of approximating the model just in the neighborhood of the nominal +voltage Vnom introduces two new points where the model is approximated. +The points are at 0.8 Vnom and 1.2 Vnom. +

+ + + + + + + + + + + + + + + + + +
EquationCondition
i ≃ PLOAD (2/(0.8 Vnom) - V/(0.8 Vnom2))V < 8/9⋅ Vnom
i ≃ PLOAD (2/(1.2 Vnom) - V/(1.2 Vnom2))V ≥ 12/11⋅ Vnom
i ≃ PLOAD (2/Vnom - V/Vnom2)Otherwise
+ +", revisions=" + +"), + Icon(coordinateSystem( + preserveAspectRatio=true, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-70,30},{70,-30}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + lineColor={0,0,255}), + Rectangle(extent={{-70,30},{70,-30}}, lineColor={0,0,255}), + Line(points={{-90,0},{-70,0}}, color={0,0,255}), + Text( + extent={{-152,87},{148,47}}, + textColor={0,0,0}, + textString="%name"), + Text( + extent={{-144,-38},{142,-70}}, + textColor={0,0,0}, + textString="G=%G")}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Line(points={{-96,0},{-70,0}}, color={0,0,255}), + Line(points={{70,0},{96,0}}, color={0,0,255}), + Rectangle(extent={{-70,30},{70,-30}}, lineColor={0,0,255})})); +end Conductor; diff --git a/IBPSA/Electrical/DC/Loads/Examples/LinearizedLoad.mo b/IBPSA/Electrical/DC/Loads/Examples/LinearizedLoad.mo new file mode 100644 index 0000000000..3ae57b5627 --- /dev/null +++ b/IBPSA/Electrical/DC/Loads/Examples/LinearizedLoad.mo @@ -0,0 +1,104 @@ +within IBPSA.Electrical.DC.Loads.Examples; +model LinearizedLoad "Example model to check the linearized load model" + extends Modelica.Icons.Example; + Real error = (sen_nlin.P - sen_lin.P)*100/sen_nlin.P + "Percentage of error between the linearized and actual power consumption"; + Real deltaV = LinearLoad.V_nominal - sen_lin.V + "Voltage distance between nominal condition and actual voltage"; + IBPSA.Electrical.DC.Loads.Conductor NonlinearLoad( + linearized=false, + mode=IBPSA.Electrical.Types.Load.VariableZ_P_input, + V_nominal=100, + P_nominal=0) "Nonlinear load model" + annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); + Sources.ConstantVoltage sou(V=100) "Voltage source" + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + Modelica.Electrical.Analog.Basic.Ground gro "Ground" + annotation (Placement(transformation(extent={{-100,-32},{-80,-12}}))); + Lines.TwoPortResistance Rline1(R=2) "Line resistance" + annotation (Placement(transformation(extent={{-50,-40},{-30,-20}}))); + Sensors.GeneralizedSensor sen_nlin "Sensor" + annotation (Placement(transformation(extent={{-10,-40},{10,-20}}))); + IBPSA.Electrical.DC.Loads.Conductor LinearLoad( + mode=IBPSA.Electrical.Types.Load.VariableZ_P_input, + V_nominal=100, + linearized=true, + P_nominal=0) "Linearized load model" + annotation (Placement(transformation(extent={{30,20},{50,40}}))); + Sensors.GeneralizedSensor sen_lin "Sensor" + annotation (Placement(transformation(extent={{-10,20},{10,40}}))); + Lines.TwoPortResistance Rline2(R=2) "Line resistance" + annotation (Placement(transformation(extent={{-50,20},{-30,40}}))); + Modelica.Blocks.Sources.Ramp ramp( + duration=0.5, + startTime=0.2, + offset=-50, + height=-950) "Power consumption" + annotation (Placement(transformation(extent={{90,-10},{70,10}}))); +equation + connect(sou.terminal, Rline1.terminal_n) + annotation (Line( + points={{-70,0},{-60,0},{-60,-30},{-50,-30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(Rline1.terminal_p, sen_nlin.terminal_n) + annotation (Line( + points={{-30,-30},{-10,-30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sen_nlin.terminal_p, NonlinearLoad.terminal) + annotation (Line( + points={{10,-30},{30,-30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(LinearLoad.terminal, sen_lin.terminal_p) + annotation (Line( + points={{30,30},{10,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sou.n, gro.p) annotation (Line( + points={{-90,0},{-90,-12}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sou.terminal, Rline2.terminal_n) annotation (Line( + points={{-70,0},{-60,0},{-60,30},{-50,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(Rline2.terminal_p, sen_lin.terminal_n) + annotation (Line( + points={{-30,30},{-10,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(LinearLoad.Pow, ramp.y) annotation (Line( + points={{50,30},{60,30},{60,6.66134e-16},{69,6.66134e-16}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(NonlinearLoad.Pow, ramp.y) annotation (Line( + points={{50,-30},{60,-30},{60,6.66134e-16},{69,6.66134e-16}}, + color={0,0,127}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-06), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/DC/Loads/Examples/LinearizedLoad.mos" + "Simulate and plot"), + Documentation(info=" +

This example demonstrates the use of a linealized load model IBPSA.Electrical.DC.Loads.Conductor.

+

Both loads are connected to the same DC voltage source through a resistive element that represents a line. The loads consume the same amount of power that is specified by the input ramp signal.

+

The nonlinear conductor model NonlinearLoad consumes exactly the amount of power specified by the input NonlinearLoad.Pow.

+

The linearized conductor model LinearizedLoad does not consumes the amount of power specified by the input LinearizedLoad.Pow. The voltage at the load deviates from the nominal value when the power consumption increases. Since the model is approximated in a neighbor of the nominal voltage, moving from that point introduces approximation errors. The plot below shows the error introduced with such an approximation.

+

\"image\"/

+

The linearized load is tested over a voltage variation of about 30 % of the nominal voltage and within this range +the maximum error is 1.23457 % that occurs when the voltage deviation is 11.11 %.

+", revisions=" + +")); +end LinearizedLoad; diff --git a/IBPSA/Electrical/DC/Loads/Examples/Resistor.mo b/IBPSA/Electrical/DC/Loads/Examples/Resistor.mo new file mode 100644 index 0000000000..5b63ce7bdb --- /dev/null +++ b/IBPSA/Electrical/DC/Loads/Examples/Resistor.mo @@ -0,0 +1,60 @@ +within IBPSA.Electrical.DC.Loads.Examples; +model Resistor "Example model for resistor" + extends Modelica.Icons.Example; + IBPSA.Electrical.DC.Loads.Resistor res2(R=2, V_nominal=12) "Resistor" + annotation (Placement(transformation(extent={{40,20},{60,40}}))); + Sources.ConstantVoltage sou(V=12) "Voltage source" + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + Modelica.Electrical.Analog.Basic.Ground gro "Ground" + annotation (Placement(transformation(extent={{-90,-2},{-70,18}}))); + Lines.TwoPortResistance res(R=2) "Line resistance" + annotation (Placement(transformation(extent={{-40,20},{-20,40}}))); + Sensors.GeneralizedSensor sen "Sensor" + annotation (Placement(transformation(extent={{0,20},{20,40}}))); + IBPSA.Electrical.DC.Loads.Resistor res1(R=2, V_nominal=12) "Resistor" + annotation (Placement(transformation(extent={{40,50},{60,70}}))); + Sensors.GeneralizedSensor sen1 "Sensor" + annotation (Placement(transformation(extent={{0,50},{20,70}}))); +equation + connect(sou.terminal, res.terminal_n) + annotation (Line( + points={{-60,30},{-40,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(res.terminal_p, sen.terminal_n) annotation (Line( + points={{-20,30},{0,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sen.terminal_p,res2. terminal) annotation (Line( + points={{20,30},{40,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(res1.terminal, sen1.terminal_p) annotation (Line( + points={{40,60},{20,60}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sen1.terminal_n, res.terminal_n) annotation (Line( + points={{0,60},{-40,60},{-40,30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sou.n, gro.p) annotation (Line( + points={{-80,30},{-80,18}}, + color={0,0,255}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-06), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/DC/Loads/Examples/Resistor.mos" + "Simulate and plot"), + Documentation(info=" +

+This example demonstrates the use of the resistor model. +

+", revisions=" + +")); +end Resistor; diff --git a/IBPSA/Electrical/DC/Loads/Examples/VariableLoad.mo b/IBPSA/Electrical/DC/Loads/Examples/VariableLoad.mo new file mode 100644 index 0000000000..bbd760c99a --- /dev/null +++ b/IBPSA/Electrical/DC/Loads/Examples/VariableLoad.mo @@ -0,0 +1,100 @@ +within IBPSA.Electrical.DC.Loads.Examples; +model VariableLoad "Example using variable loads models" + extends Modelica.Icons.Example; + Conductor loa1( + V_nominal=12, + linearized=false, + P_nominal=-50) "Load" + annotation (Placement(transformation(extent={{40,40},{60,60}}))); + Sources.ConstantVoltage sou(V=12) "Voltage source" + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + Modelica.Electrical.Analog.Basic.Ground gro "Ground" + annotation (Placement(transformation(extent={{-90,-2},{-70,18}}))); + Conductor loa2( mode=Types.Load.VariableZ_y_input, + V_nominal=12, + P_nominal=-50) "Load" + annotation (Placement(transformation(extent={{0,0},{20,20}}))); + Modelica.Blocks.Sources.Ramp varLoad_y( + height=0.8, + duration=0.5, + startTime=0.3, + offset=0) "Power signal" + annotation (Placement(transformation(extent={{60,0},{40,20}}))); + Conductor loa3( + V_nominal=12, + P_nominal=0, + mode=IBPSA.Electrical.Types.Load.VariableZ_P_input) "Load" + annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); + Modelica.Blocks.Sources.Ramp varLoad_P( + duration=0.5, + startTime=0.3, + height=120, + offset=-20) "Power signal" + annotation (Placement(transformation(extent={{60,-40},{40,-20}}))); + Lines.TwoPortResistance res(R=0.1) "Line resistance" + annotation (Placement(transformation(extent={{-32,40},{-12,60}}))); + Sensors.GeneralizedSensor sen "Sensor" + annotation (Placement(transformation(extent={{0,40},{20,60}}))); +equation + connect(sou.terminal, loa2.terminal) + annotation (Line( + points={{-60,30},{-40,30},{-40,10},{-4.44089e-16,10}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(varLoad_y.y, loa2.y) annotation (Line( + points={{39,10},{20,10}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(sou.terminal, loa3.terminal) + annotation (Line( + points={{-60,30},{-40,30},{-40,-30},{-4.44089e-16,-30}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(varLoad_P.y, loa3.Pow) annotation (Line( + points={{39,-30},{20,-30}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(sou.terminal, res.terminal_n) + annotation (Line( + points={{-60,30},{-40,30},{-40,50},{-32,50}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(res.terminal_p, sen.terminal_n) annotation (Line( + points={{-12,50},{0,50}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sen.terminal_p, loa1.terminal) annotation (Line( + points={{20,50},{40,50}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sou.n, gro.p) annotation (Line( + points={{-80,30},{-80,18}}, + color={0,0,255}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0, Tolerance=1e-06), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/DC/Loads/Examples/VariableLoad.mos" + "Simulate and plot"), + Documentation(info=" +

+This example shows how to use three different types of load models. +Each load is of type +IBPSA.Electrical.DC.Loads.Conductor. +

+

+The first load loa1consumes a constant amount of power. +The second and the third loads (loa2 and loa3) consume a variable amount of power. +The load loa2 has a variable input y between 0 and 1 that specifies the portion of +nominal power that is consumed. +The load loa3 has a variable input Pow that represents the actual power consumed +(or produced) by the load. +

+", revisions=" + +")); +end VariableLoad; diff --git a/IBPSA/Electrical/DC/Loads/Examples/package.mo b/IBPSA/Electrical/DC/Loads/Examples/package.mo new file mode 100644 index 0000000000..f51a3fcea4 --- /dev/null +++ b/IBPSA/Electrical/DC/Loads/Examples/package.mo @@ -0,0 +1,13 @@ +within IBPSA.Electrical.DC.Loads; +package Examples "Package with example models" +extends Modelica.Icons.ExamplesPackage; + + +annotation (Documentation(info=" +

+This package contains examples for the use of models that can be found in + +IBPSA.Electrical.DC.Loads. +

+")); +end Examples; diff --git a/IBPSA/Electrical/DC/Loads/Examples/package.order b/IBPSA/Electrical/DC/Loads/Examples/package.order new file mode 100644 index 0000000000..815b57469d --- /dev/null +++ b/IBPSA/Electrical/DC/Loads/Examples/package.order @@ -0,0 +1,3 @@ +LinearizedLoad +Resistor +VariableLoad diff --git a/IBPSA/Electrical/DC/Loads/Resistor.mo b/IBPSA/Electrical/DC/Loads/Resistor.mo new file mode 100644 index 0000000000..6d4cc2afa0 --- /dev/null +++ b/IBPSA/Electrical/DC/Loads/Resistor.mo @@ -0,0 +1,97 @@ +within IBPSA.Electrical.DC.Loads; +model Resistor "Ideal linear electrical resistor" + extends IBPSA.Electrical.Interfaces.ResistiveLoad( + redeclare package PhaseSystem = PhaseSystems.TwoConductor, + redeclare Interfaces.Terminal_n terminal, + final mode=IBPSA.Electrical.Types.Load.FixedZ_steady_state, + final P_nominal=V_nominal^2/max(R, Modelica.Constants.small)); + extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = T_ref); + parameter Modelica.Units.SI.Resistance R(start=1) + "Resistance at temperature T_ref"; + parameter Modelica.Units.SI.Temperature T_ref=300.15 "Reference temperature"; + parameter Modelica.Units.SI.LinearTemperatureCoefficient alpha=0 + "Temperature coefficient of resistance (R_actual = R*(1 + alpha*(T_heatPort - T_ref))"; + Modelica.Units.SI.Resistance R_actual + "Actual resistance = R*(1 + alpha*(T_heatPort - T_ref))"; +equation + assert((1 + alpha*(T_heatPort - T_ref)) >= Modelica.Constants.eps, "Temperature outside of scope of model"); + R_actual = R*(1 + alpha*(T_heatPort - T_ref)); + PhaseSystem.systemVoltage(v) = R_actual*PhaseSystem.systemCurrent(i); + LossPower = PhaseSystem.activePower(v,i); + sum(i) = 0; + annotation ( + Documentation(info=" +

+Model of a linear DC resistor that can vary with respect to temperature. +

+

+The model implements the Ohm's law +

+

+V = R(T) i. +

+

+The resistance R(T) varies depending on the temperature T as +

+

+R(T) = R (1 + α (T - Tref)), +

+

+where the resistance R is the reference value of the resistance, α is the +linear temperature coefficient, and Tref is the reference temperature. +The temperature T is the temperature of the heat port if useHeatPort = true. +

+", + revisions=" + +"), + Icon(coordinateSystem( + preserveAspectRatio=true, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle( + extent={{-70,30},{70,-30}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{-90,0},{-70,0}}, color={0,0,255}), + Text( + extent={{-144,-40},{142,-72}}, + textColor={0,0,0}, + textString="R=%R"), + Line( + visible=useHeatPort, + points={{0,-100},{0,-30}}, + color={127,0,0}, + smooth=Smooth.None, + pattern=LinePattern.Dot), + Text( + extent={{-152,87},{148,47}}, + textColor={0,0,0}, + textString="%name")}), + Diagram(coordinateSystem( + preserveAspectRatio=true, + extent={{-100,-100},{100,100}}, + grid={2,2}), graphics={ + Rectangle(extent={{-70,30},{70,-30}}, lineColor={0,0,255}), + Line(points={{-96,0},{-70,0}}, color={0,0,255})})); +end Resistor; diff --git a/IBPSA/Electrical/DC/Loads/package.mo b/IBPSA/Electrical/DC/Loads/package.mo new file mode 100644 index 0000000000..b6cf03d634 --- /dev/null +++ b/IBPSA/Electrical/DC/Loads/package.mo @@ -0,0 +1,11 @@ +within IBPSA.Electrical.DC; +package Loads "Package with models for DC electrical loads" + extends Modelica.Icons.VariantsPackage; + + +annotation (Documentation(info=" +

+This package contains models that represent different types of DC loads. +

+")); +end Loads; diff --git a/IBPSA/Electrical/DC/Loads/package.order b/IBPSA/Electrical/DC/Loads/package.order new file mode 100644 index 0000000000..7e5a266009 --- /dev/null +++ b/IBPSA/Electrical/DC/Loads/package.order @@ -0,0 +1,3 @@ +Conductor +Resistor +Examples diff --git a/IBPSA/Electrical/DC/Sensors/Examples/GeneralizedSensor.mo b/IBPSA/Electrical/DC/Sensors/Examples/GeneralizedSensor.mo new file mode 100644 index 0000000000..0e2200a7cc --- /dev/null +++ b/IBPSA/Electrical/DC/Sensors/Examples/GeneralizedSensor.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.DC.Sensors.Examples; +model GeneralizedSensor "Example model for generalized sensor" + extends Modelica.Icons.Example; + IBPSA.Electrical.DC.Sensors.GeneralizedSensor sen "Power sensor" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + IBPSA.Electrical.DC.Loads.Conductor loa(V_nominal=120, P_nominal=120) + "Constant load" + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + IBPSA.Electrical.DC.Sources.ConstantVoltage sou(V=120) "Voltage source" + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + Modelica.Electrical.Analog.Basic.Ground ground + annotation (Placement(transformation(extent={{-60,-32},{-40,-12}}))); +equation + connect(sen.terminal_p, loa.terminal) + annotation (Line(points={{10,0},{40,0}}, smooth=Smooth.None)); + connect(sen.terminal_n, sou.terminal) + annotation (Line(points={{-10,0},{-30,0}}, smooth=Smooth.None)); + connect(sou.n, ground.p) annotation (Line( + points={{-50,0},{-50,-12}}, + color={0,0,255}, + smooth=Smooth.None)); + annotation ( experiment(StopTime=1.0,Tolerance=1e-06), + Documentation( + info=" +

+This example illustrates the use of the generalized sensor. +

+", +revisions=" + +"), +__Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/DC/Sensors/Examples/GeneralizedSensor.mos" + "Simulate and plot")); +end GeneralizedSensor; diff --git a/IBPSA/Electrical/DC/Sensors/Examples/package.mo b/IBPSA/Electrical/DC/Sensors/Examples/package.mo new file mode 100644 index 0000000000..b33931b3e6 --- /dev/null +++ b/IBPSA/Electrical/DC/Sensors/Examples/package.mo @@ -0,0 +1,13 @@ +within IBPSA.Electrical.DC.Sensors; +package Examples "Collection of models that illustrate model use and test models" + extends Modelica.Icons.ExamplesPackage; + + +annotation (preferredView="info", Documentation(info=" +

+This package contains examples for the use of models that can be found in + +IBPSA.Electrical.DC.Sensors. +

+")); +end Examples; diff --git a/IBPSA/Electrical/DC/Sensors/Examples/package.order b/IBPSA/Electrical/DC/Sensors/Examples/package.order new file mode 100644 index 0000000000..b638efa963 --- /dev/null +++ b/IBPSA/Electrical/DC/Sensors/Examples/package.order @@ -0,0 +1 @@ +GeneralizedSensor diff --git a/IBPSA/Electrical/DC/Sensors/GeneralizedSensor.mo b/IBPSA/Electrical/DC/Sensors/GeneralizedSensor.mo new file mode 100644 index 0000000000..25efccc657 --- /dev/null +++ b/IBPSA/Electrical/DC/Sensors/GeneralizedSensor.mo @@ -0,0 +1,85 @@ +within IBPSA.Electrical.DC.Sensors; +model GeneralizedSensor "Sensor for power, voltage and current" + extends IBPSA.Electrical.Icons.GeneralizedSensor; + extends IBPSA.Electrical.Interfaces.PartialTwoPort( + redeclare package PhaseSystem_p = PhaseSystems.TwoConductor, + redeclare package PhaseSystem_n = PhaseSystems.TwoConductor, + redeclare Interfaces.Terminal_n terminal_n, + redeclare Interfaces.Terminal_p terminal_p); + Modelica.Blocks.Interfaces.RealOutput V(final quantity="ElectricPotential", + final unit="V") "Voltage" + annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-50}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-90}))); + Modelica.Blocks.Interfaces.RealOutput I(final quantity="ElectricCurrent", + final unit="A") "Current" + annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={60,-50}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={60,-90}))); + Modelica.Blocks.Interfaces.RealOutput P( + final quantity="Power", + final unit="W") "Power" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-60,-50}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-60,-90}))); +equation + Connections.branch(terminal_p.theta, terminal_n.theta); + terminal_p.theta = terminal_n.theta; + + V = IBPSA.Electrical.PhaseSystems.TwoConductor.systemVoltage(terminal_n.v); + I = IBPSA.Electrical.PhaseSystems.TwoConductor.systemCurrent(terminal_n.i); + P = IBPSA.Electrical.PhaseSystems.TwoConductor.activePower(v=terminal_n.v, i=terminal_n.i); + + connect(terminal_n, terminal_p) annotation (Line( + points={{-100,0},{100,0}}, + color={0,0,255}, + smooth=Smooth.None)); + + annotation (defaultComponentName="sen", + Documentation(info=" +

+Ideal sensor that measures power, voltage and current. +The two components of the power S are the active and reactive power. +As this sensor is configured to measure DC power, the reactive power is always zero. +

+", revisions=" + +"), + Icon(graphics={ + Text( + extent={{-120,-42},{0,-82}}, + textColor={0,0,0}, + lineThickness=1, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + textString="P")})); +end GeneralizedSensor; diff --git a/IBPSA/Electrical/DC/Sensors/package.mo b/IBPSA/Electrical/DC/Sensors/package.mo new file mode 100644 index 0000000000..9ecc8222d9 --- /dev/null +++ b/IBPSA/Electrical/DC/Sensors/package.mo @@ -0,0 +1,11 @@ +within IBPSA.Electrical.DC; +package Sensors "Package with sensors for DC electrical systems" +extends Modelica.Icons.SensorsPackage; + + +annotation (Documentation(info=" +

+This package contains models for sensors for DC circuits. +

+")); +end Sensors; diff --git a/IBPSA/Electrical/DC/Sensors/package.order b/IBPSA/Electrical/DC/Sensors/package.order new file mode 100644 index 0000000000..2923d15c82 --- /dev/null +++ b/IBPSA/Electrical/DC/Sensors/package.order @@ -0,0 +1,2 @@ +GeneralizedSensor +Examples diff --git a/IBPSA/Electrical/DC/Sources/BaseClasses/WindCorrection.mo b/IBPSA/Electrical/DC/Sources/BaseClasses/WindCorrection.mo new file mode 100644 index 0000000000..7e19eea416 --- /dev/null +++ b/IBPSA/Electrical/DC/Sources/BaseClasses/WindCorrection.mo @@ -0,0 +1,75 @@ +within Buildings.Electrical.DC.Sources.BaseClasses; +block WindCorrection "Block for wind correction" + extends Modelica.Blocks.Icons.Block; + parameter Modelica.Units.SI.Height h "Height over ground"; + parameter Modelica.Units.SI.Height hRef + "Reference height for wind measurement"; + parameter Real n(min=0) = 0.4 "Height exponent for wind profile calculation"; + Modelica.Blocks.Interfaces.RealOutput vLoc( unit="m/s") + "Wind velocity at the location" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.RealInput vRef(unit="m/s") + "Wind velocity at the reference height" + annotation (Placement(transformation(extent={{-120,-10},{-100,10}}), + iconTransformation(extent={{-142,-20},{-102,20}}))); +equation + vLoc=vRef * (h / hRef)^n; + annotation ( + defaultComponentName = "cor", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), + graphics={ + Text( + extent={{-92,48},{-32,-50}}, + textColor={0,128,255}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + textString="vRef"), + Polygon( + points={{26,0},{6,20},{6,10},{-24,10},{-24,-10},{6,-10},{6,-20},{26,0}}, + lineColor={0,128,255}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{30,50},{90,-48}}, + textColor={0,128,0}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + textString="vLoc")}),Documentation(info=" +

+This model calculates the wind velocity at the location as a function of the height over ground. +The equation is based on Gash (1991). + +The model computes the wind velocity vLoc as +

+ +

+vLoc = vRef * (h / hRef)n +

+ +

+where vRef is the wind velocity at the reference height, h is the height over ground, hRef +is the reference height, and n is the height exponent for wind calculation. +

+

Reference

+

+Gasch, R. 1991. Windkraftanlagen. Grundlagen und Entwurf (German). Teubner, Stuttgart. +

+", +revisions=" + +")); +end WindCorrection; diff --git a/IBPSA/Electrical/DC/Sources/BaseClasses/package.mo b/IBPSA/Electrical/DC/Sources/BaseClasses/package.mo new file mode 100644 index 0000000000..def396379d --- /dev/null +++ b/IBPSA/Electrical/DC/Sources/BaseClasses/package.mo @@ -0,0 +1,12 @@ +within Buildings.Electrical.DC.Sources; +package BaseClasses "Package with base classes for DC sources" + extends Modelica.Icons.BasesPackage; + + +annotation (Documentation(info=" +

+This package contains base classes that are used to construct the models in +Buildings.Electrical.DC.Sources. +

+")); +end BaseClasses; diff --git a/IBPSA/Electrical/DC/Sources/BaseClasses/package.order b/IBPSA/Electrical/DC/Sources/BaseClasses/package.order new file mode 100644 index 0000000000..b7efbc807b --- /dev/null +++ b/IBPSA/Electrical/DC/Sources/BaseClasses/package.order @@ -0,0 +1 @@ +WindCorrection diff --git a/IBPSA/Electrical/DC/Sources/ConstantVoltage.mo b/IBPSA/Electrical/DC/Sources/ConstantVoltage.mo new file mode 100644 index 0000000000..380fc626a4 --- /dev/null +++ b/IBPSA/Electrical/DC/Sources/ConstantVoltage.mo @@ -0,0 +1,59 @@ +within IBPSA.Electrical.DC.Sources; +model ConstantVoltage "Model of a constant DC voltage source" + extends IBPSA.Electrical.Interfaces.Source( + redeclare package PhaseSystem = PhaseSystems.TwoConductor, + redeclare Interfaces.Terminal_p terminal, + final potentialReference=true, + final definiteReference=false); + parameter Modelica.Units.SI.Voltage V(start=1) "Value of constant voltage"; + Modelica.Electrical.Analog.Interfaces.NegativePin n "Negative pin" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); +equation + terminal.v[1] = V; + terminal.v[2] = n.v; + sum(terminal.i) + n.i = 0; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Line(points={{-40,0},{40,0}}, color={0,0,0}, + origin={10,0}, + rotation=90), + Line(points={{0,26},{0,-54}}, color={0,0,0}, + origin={36,0}, + rotation=90), + Line(points={{0,46},{0,-34}}, color={0,0,0}, + origin={-44,0}, + rotation=90), + Line(points={{-20,0},{20,0}}, + color={0,0,0}, + origin={-10,0}, + rotation=90), + Text( + extent={{50,70},{150,20}}, + textColor={0,0,0}, + textString="+"), + Text( + extent={{50,-12},{150,-62}}, + textColor={0,0,0}, + textString="-"), + Text( + extent={{-150,60},{150,100}}, + textColor={0,0,0}, + textString="V=%V")}), Documentation(info=" +

+This model represents a simple DC voltage source with constant voltage. +

+", revisions=" + +")); +end ConstantVoltage; diff --git a/IBPSA/Electrical/DC/Sources/Examples/VoltageSource.mo b/IBPSA/Electrical/DC/Sources/Examples/VoltageSource.mo new file mode 100644 index 0000000000..490cfbbd27 --- /dev/null +++ b/IBPSA/Electrical/DC/Sources/Examples/VoltageSource.mo @@ -0,0 +1,63 @@ +within IBPSA.Electrical.DC.Sources.Examples; +model VoltageSource "Example for the variable voltage source model" + extends Modelica.Icons.Example; + Modelica.Electrical.Analog.Basic.Ground ground + annotation (Placement(transformation(extent={{-92,-40},{-72,-20}}))); + IBPSA.Electrical.DC.Loads.Resistor res(R=0.5, V_nominal=12) + "Resistance" + annotation (Placement(transformation(extent={{26,-10},{46,10}}))); + IBPSA.Electrical.DC.Sources.VoltageSource sou "Voltage source" + annotation (Placement(transformation(extent={{-82,-10},{-62,10}}))); + IBPSA.Electrical.DC.Lines.TwoPortResistance lin(R=0.5) + "Transmission line" + annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); + IBPSA.Electrical.DC.Sensors.GeneralizedSensor sen "Sensor" + annotation (Placement(transformation(extent={{-14,-10},{6,10}}))); + Modelica.Blocks.Sources.Sine cosine( + phase=0, + f=1, + offset=12, + amplitude=3) "Variable voltage signal" + annotation (Placement(transformation(extent={{-120,-4},{-100,16}}))); +equation + connect(lin.terminal_p, sen.terminal_n) annotation (Line( + points={{-32,0},{-14,0}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sou.n, ground.p) annotation (Line( + points={{-82,0},{-82,-20}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sen.terminal_p, res.terminal) annotation (Line( + points={{6,0},{26,0}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(sou.terminal, lin.terminal_n) annotation (Line( + points={{-62,0},{-52,0}}, + color={0,0,255}, + smooth=Smooth.None)); + connect(cosine.y, sou.V_in) annotation (Line( + points={{-99,6},{-82,6}}, + color={0,0,127}, + smooth=Smooth.None)); + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-140, + -100},{100,140}}), graphics), + experiment(StopTime=1, Tolerance=1e-6), +Documentation(info=" +

+This model illustrates the use of the variable voltage source model. +

+", + revisions=" + +"), + __Dymola_Commands(file= + "modelica://IBPSA/Resources/Scripts/Dymola/Electrical/DC/Sources/Examples/VoltageSource.mos" + "Simulate and plot"), + Icon(coordinateSystem(extent={{-140,-100},{100,140}}))); +end VoltageSource; diff --git a/IBPSA/Electrical/DC/Sources/Examples/package.mo b/IBPSA/Electrical/DC/Sources/Examples/package.mo new file mode 100644 index 0000000000..7e2b02151a --- /dev/null +++ b/IBPSA/Electrical/DC/Sources/Examples/package.mo @@ -0,0 +1,13 @@ +within IBPSA.Electrical.DC.Sources; +package Examples "Package with example models" + extends Modelica.Icons.ExamplesPackage; + + +annotation (Documentation(info=" +

+This package contains examples for the use of models that can be found in + +IBPSA.Electrical.DC.Sources. +

+")); +end Examples; diff --git a/IBPSA/Electrical/DC/Sources/Examples/package.order b/IBPSA/Electrical/DC/Sources/Examples/package.order new file mode 100644 index 0000000000..800d45b3d3 --- /dev/null +++ b/IBPSA/Electrical/DC/Sources/Examples/package.order @@ -0,0 +1 @@ +VoltageSource diff --git a/IBPSA/Electrical/DC/Sources/VoltageSource.mo b/IBPSA/Electrical/DC/Sources/VoltageSource.mo new file mode 100644 index 0000000000..7994282b25 --- /dev/null +++ b/IBPSA/Electrical/DC/Sources/VoltageSource.mo @@ -0,0 +1,53 @@ +within IBPSA.Electrical.DC.Sources; +model VoltageSource "Model of a generoic DC voltage source" + extends IBPSA.Electrical.Interfaces.VariableVoltageSource( + V(start = 1), + redeclare package PhaseSystem = PhaseSystems.TwoConductor, + redeclare Interfaces.Terminal_p terminal, + final potentialReference=true, + final definiteReference=false); + Modelica.Electrical.Analog.Interfaces.NegativePin n "Negative pin" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); +equation + terminal.v[1] = V_in_internal; + terminal.v[2] = n.v; + sum(terminal.i) + n.i = 0; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Line(points={{-40,0},{40,0}}, color={0,0,0}, + origin={10,0}, + rotation=90), + Line(points={{0,26},{0,-54}}, color={0,0,0}, + origin={36,0}, + rotation=90), + Line(points={{0,46},{0,-34}}, color={0,0,0}, + origin={-44,0}, + rotation=90), + Line(points={{-20,0},{20,0}}, + color={0,0,0}, + origin={-10,0}, + rotation=90), + Text( + extent={{50,70},{150,20}}, + textColor={0,0,0}, + textString="+"), + Text( + extent={{50,-12},{150,-62}}, + textColor={0,0,0}, + textString="-"), + Text(visible = not use_V_in, + extent={{-150,60},{150,100}}, + textColor={0,0,0}, + textString="V=%V")}), Documentation(info=" +

+This model represents a simple DC voltage source with variable voltage. +

+", revisions=" + +")); +end VoltageSource; diff --git a/IBPSA/Electrical/DC/Sources/package.mo b/IBPSA/Electrical/DC/Sources/package.mo new file mode 100644 index 0000000000..79f0146fec --- /dev/null +++ b/IBPSA/Electrical/DC/Sources/package.mo @@ -0,0 +1,11 @@ +within IBPSA.Electrical.DC; +package Sources "Package with models for DC sources" + extends Modelica.Icons.SourcesPackage; + + +annotation (Documentation(info=" +

+This package contains models that represent different types of DC sources. +

+")); +end Sources; diff --git a/IBPSA/Electrical/DC/Sources/package.order b/IBPSA/Electrical/DC/Sources/package.order new file mode 100644 index 0000000000..44097be245 --- /dev/null +++ b/IBPSA/Electrical/DC/Sources/package.order @@ -0,0 +1,4 @@ +ConstantVoltage +VoltageSource +Examples +BaseClasses diff --git a/IBPSA/Electrical/DC/package.mo b/IBPSA/Electrical/DC/package.mo new file mode 100644 index 0000000000..7954dfbb21 --- /dev/null +++ b/IBPSA/Electrical/DC/package.mo @@ -0,0 +1,36 @@ +within IBPSA.Electrical; +package DC "Package for analog direct current (DC) electrical circuits" + extends Modelica.Icons.Package; + + + annotation (Documentation(info=" +

+Package with models for direct current (DC) systems.
+The models contained in this package use the phase system IBPSA.Electrical.PhaseSystems.TwoConductor. +

+", revisions=" + +"), Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Line( + points={{-82,20},{58,20}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-82,-18},{-52,-18},{-42,-18}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-22,-18},{-2,-18},{-2,-18}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{18,-18},{48,-18},{58,-18}}, + color={0,0,0}, + smooth=Smooth.None)})); +end DC; diff --git a/IBPSA/Electrical/DC/package.order b/IBPSA/Electrical/DC/package.order new file mode 100644 index 0000000000..70a7510015 --- /dev/null +++ b/IBPSA/Electrical/DC/package.order @@ -0,0 +1,5 @@ +Interfaces +Lines +Loads +Sensors +Sources diff --git a/IBPSA/Electrical/Icons/GeneralizedProbe.mo b/IBPSA/Electrical/Icons/GeneralizedProbe.mo new file mode 100644 index 0000000000..76d4fc6703 --- /dev/null +++ b/IBPSA/Electrical/Icons/GeneralizedProbe.mo @@ -0,0 +1,49 @@ +within IBPSA.Electrical.Icons; +partial class GeneralizedProbe + "Icon representing a generalized probe that measures voltage, and phase angle" + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Rectangle( + extent={{-40,30},{40,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + origin={1.77636e-15,-40}, + rotation=90), + Ellipse( + extent={{-60,60},{60,-60}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-0.48,33.6},{18,28},{18,59.2},{-0.48,33.6}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Line(points={{-37.6,15.7},{-54,22}}, color={0,0,0}), + Line(points={{-22.9,34.8},{-32,50}}, color={0,0,0}), + Line(points={{0,60},{0,42}}, color={0,0,0}), + Line(points={{22.9,34.8},{32,50}}, color={0,0,0}), + Line(points={{37.6,15.7},{54,24}}, color={0,0,0}), + Line(points={{0,2},{9.02,30.6}}, color={0,0,0}), + Ellipse( + extent={{-5,7},{5,-3}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{-140,110},{140,70}}, + textColor={0,0,0}, + textString="%name")}), Documentation(info=" +

+This is the icon for a probe that measure voltage magnitude and phase. +

+", revisions=" + +")); +end GeneralizedProbe; diff --git a/IBPSA/Electrical/Icons/GeneralizedSensor.mo b/IBPSA/Electrical/Icons/GeneralizedSensor.mo new file mode 100644 index 0000000000..06c86d972d --- /dev/null +++ b/IBPSA/Electrical/Icons/GeneralizedSensor.mo @@ -0,0 +1,68 @@ +within IBPSA.Electrical.Icons; +partial class GeneralizedSensor + "Icon representing a generalized sensor that measures voltage, current and power" + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Rectangle( + extent={{-70,28},{70,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-60,60},{60,-60}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-92,0},{-70,0}}, + color={0,0,0}, + smooth=Smooth.None), + Polygon( + points={{-0.48,33.6},{18,28},{18,59.2},{-0.48,33.6}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Line(points={{-37.6,15.7},{-54,22}}, color={0,0,0}), + Line(points={{-22.9,34.8},{-32,50}}, color={0,0,0}), + Line(points={{0,60},{0,42}}, color={0,0,0}), + Line(points={{22.9,34.8},{32,50}}, color={0,0,0}), + Line(points={{37.6,15.7},{54,24}}, color={0,0,0}), + Line(points={{0,2},{9.02,30.6}}, color={0,0,0}), + Ellipse( + extent={{-5,7},{5,-3}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Line( + points={{70,0},{92,0}}, + color={0,0,0}, + smooth=Smooth.None), + Text( + extent={{-60,-42},{60,-82}}, + textColor={0,0,0}, + lineThickness=1, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + textString="V"), + Text( + extent={{0,-40},{120,-80}}, + textColor={0,0,0}, + lineThickness=1, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + textString="I"), Text( + extent={{-140,110},{140,70}}, + textColor={0,0,0}, + textString="%name")}), Documentation(info=" +

+This is the icon for ideal sensors that measure power, voltage and current. +

+", revisions=" + +")); +end GeneralizedSensor; diff --git a/IBPSA/Electrical/Icons/RefAngleConversion.mo b/IBPSA/Electrical/Icons/RefAngleConversion.mo new file mode 100644 index 0000000000..53fe93b9c4 --- /dev/null +++ b/IBPSA/Electrical/Icons/RefAngleConversion.mo @@ -0,0 +1,45 @@ +within IBPSA.Electrical.Icons; +partial model RefAngleConversion + "Icon that represents if the angle symble should be displayed or not" + annotation (Icon(graphics={ + Line(visible = ground_2 == true, + points={{80,-40},{120,-40}}, + color={0,120,120}, + smooth=Smooth.None, + thickness=0.5), + Line(visible = ground_2 == true, + points={{80,-40},{106,-14}}, + color={0,120,120}, + smooth=Smooth.None, + thickness=0.5), + Line(visible = ground_2 == true, + points={{102,-16},{114,-24},{118,-42}}, + color={0,120,120}, + smooth=Smooth.Bezier), + Line(visible = ground_1 == true, + points={{-102,-16},{-114,-24},{-118,-42}}, + color={0,120,120}, + smooth=Smooth.Bezier), + Line(visible = ground_1 == true, + points={{-80,-40},{-106,-14}}, + color={0,120,120}, + smooth=Smooth.None, + thickness=0.5), + Line(visible = ground_1 == true, + points={{-80,-40},{-120,-40}}, + color={0,120,120}, + smooth=Smooth.None, + thickness=0.5)}), Documentation(info=" +

+This is the icon that conditionally draws the angle symbol for a +conversion model (e.g., a transformer). +

+", revisions=" + +")); +end RefAngleConversion; diff --git a/IBPSA/Electrical/Icons/package.mo b/IBPSA/Electrical/Icons/package.mo new file mode 100644 index 0000000000..c3dce74006 --- /dev/null +++ b/IBPSA/Electrical/Icons/package.mo @@ -0,0 +1,18 @@ +within IBPSA.Electrical; +package Icons "This package contains icons used by the electric models" + extends Modelica.Icons.IconsPackage; + + +annotation (Documentation(revisions=" + +", info=" +

+Package that contains icons. +

+")); +end Icons; diff --git a/IBPSA/Electrical/Icons/package.order b/IBPSA/Electrical/Icons/package.order new file mode 100644 index 0000000000..b8b8852717 --- /dev/null +++ b/IBPSA/Electrical/Icons/package.order @@ -0,0 +1,3 @@ +GeneralizedProbe +GeneralizedSensor +RefAngleConversion diff --git a/IBPSA/Electrical/Interfaces/BaseTerminal.mo b/IBPSA/Electrical/Interfaces/BaseTerminal.mo new file mode 100644 index 0000000000..cfc4238d6a --- /dev/null +++ b/IBPSA/Electrical/Interfaces/BaseTerminal.mo @@ -0,0 +1,15 @@ +within IBPSA.Electrical.Interfaces; +connector BaseTerminal "Empty connector used by partial models" + + annotation (Documentation(info=" +This empty connector represents the base class extended by every electric connector of type +IBPSA.Electrical.Interfaces.Terminal. +", revisions=" + +")); +end BaseTerminal; diff --git a/IBPSA/Electrical/Interfaces/CapacitiveLoad.mo b/IBPSA/Electrical/Interfaces/CapacitiveLoad.mo new file mode 100644 index 0000000000..9fc071271e --- /dev/null +++ b/IBPSA/Electrical/Interfaces/CapacitiveLoad.mo @@ -0,0 +1,67 @@ +within IBPSA.Electrical.Interfaces; +partial model CapacitiveLoad "Partial model of a capacitive load" + extends Load; + parameter Boolean use_pf_in = false "If true, the power factor is defined by an input" + annotation(Dialog(group="Modeling assumption")); + parameter Real pf(min=0, max=1) = 0.8 "Power factor" + annotation(Dialog(group="Nominal conditions")); + Modelica.Blocks.Interfaces.RealInput pf_in( + min=0, + max=1, + unit="1") if (use_pf_in) "Power factor" + annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=180, + origin={100,60}), iconTransformation( + extent={{-20,-20},{20,20}}, + rotation=180, + origin={100,60}))); +protected + function j = PhaseSystem.j "J operator that rotates of 90 degrees"; + Modelica.Blocks.Interfaces.RealInput pf_internal + "Hidden value of the input load for the conditional connector"; + Modelica.Units.SI.ElectricCharge q[2](each stateSelect=StateSelect.prefer) + "Electric charge"; + Modelica.Units.SI.Admittance[2] Y "Admittance"; + Modelica.Units.SI.AngularVelocity omega "Angular velocity"; + Modelica.Units.SI.Power Q=P*tan(-acos(pf_internal)) + "Reactive power (negative because capacitive load)"; +equation + connect(pf_in, pf_internal); + + if not use_pf_in then + pf_internal = pf; + end if; + + annotation (Documentation(revisions=" + +", info=" +

+This is a model of a generic capacitive load. This model is an extension of the base load model +IBPSA.Electrical.Interfaces.Load. +

+

+This model assumes a fixed power factor pf when the flag use_pf_in = false +otherwise it uses the power factor specified by the input pf_in. +

+

The power factor (either the input or the parameter) is used to compute the reactive power +Q given the active power P +

+

+Q = - P * tan(arccos(pf)) +

+")); +end CapacitiveLoad; diff --git a/IBPSA/Electrical/Interfaces/Ground.mo b/IBPSA/Electrical/Interfaces/Ground.mo new file mode 100644 index 0000000000..4aabbba875 --- /dev/null +++ b/IBPSA/Electrical/Interfaces/Ground.mo @@ -0,0 +1,35 @@ +within IBPSA.Electrical.Interfaces; +model Ground "Generalized model of a ground connection." + replaceable package PhaseSystem = + IBPSA.Electrical.PhaseSystems.PartialPhaseSystem constrainedby + IBPSA.Electrical.PhaseSystems.PartialPhaseSystem "Phase system" + annotation (choicesAllMatching=true); + + replaceable IBPSA.Electrical.Interfaces.Terminal terminal(redeclare + package PhaseSystem = PhaseSystem) "Generalized terminal" + annotation (Placement(transformation(extent={{-8,92},{8,108}}), + iconTransformation(extent={{-8,92},{8,108}}))); +equation + terminal.v = zeros(PhaseSystem.n); + annotation (Documentation(info=" +

+Given a generic electric connector + +IBPSA.Electrical.Interfaces.Terminal this +model imposes the following condition on the voltage V[PhaseSystem.n] +

+

+V = 0, +

+

+where 0 is a null vector of length PhaseSystem.n. +

+", revisions=" + +")); +end Ground; diff --git a/IBPSA/Electrical/Interfaces/Impedance.mo b/IBPSA/Electrical/Interfaces/Impedance.mo new file mode 100644 index 0000000000..6c251a736a --- /dev/null +++ b/IBPSA/Electrical/Interfaces/Impedance.mo @@ -0,0 +1,196 @@ +within IBPSA.Electrical.Interfaces; +model Impedance "Partial model representing a generalized impedance" + extends IBPSA.Electrical.Interfaces.Load( + final linearized = false, + final mode=IBPSA.Electrical.Types.Load.FixedZ_steady_state, + final P_nominal(fixed = true)=0, + final V_nominal(fixed = true)=1); + parameter Boolean inductive=true + "If true, the load is inductive, otherwise it is capacitive" + annotation (Evaluate=true, choices( + choice=true "Inductive", + choice=false "Capacitive", + __Dymola_radioButtons=true)); + parameter Modelica.Units.SI.Resistance R( + start=1, + min=0) = 1 "Resistance" annotation (Dialog(enable=not use_R_in)); + parameter Modelica.Units.SI.Inductance L( + start=0, + min=0) = 0 "Inductance" + annotation (Dialog(enable=inductive and (not use_L_in))); + parameter Modelica.Units.SI.Capacitance C( + start=0, + min=0) = 0 "Capacitance" + annotation (Dialog(enable=(not inductive) and (not use_C_in))); + parameter Boolean use_R_in = false "If true, R is specified by an input" + annotation(Evaluate=true, Dialog(tab = "Variable load", group="Resistance")); + parameter Modelica.Units.SI.Resistance RMin( + start=R, + min=Modelica.Constants.eps) = 1e-4 "Minimum value of the resistance" + annotation (Evaluate=true, Dialog( + enable=use_R_in, + tab="Variable load", + group="Resistance")); + parameter Modelica.Units.SI.Resistance RMax( + start=R, + min=Modelica.Constants.eps) = 1e2 "Maximum value of the resistance" + annotation (Evaluate=true, Dialog( + enable=use_R_in, + tab="Variable load", + group="Resistance")); + parameter Boolean use_C_in = false "If true, C is specified by an input" + annotation(Evaluate=true, Dialog(tab = "Variable load", group="Capacitance")); + parameter Modelica.Units.SI.Capacitance CMin( + start=C, + min=Modelica.Constants.eps) = 1e-4 "Minimum value of the capacitance" + annotation (Evaluate=true, Dialog( + enable=use_C_in, + tab="Variable load", + group="Capacitance")); + parameter Modelica.Units.SI.Capacitance CMax( + start=C, + min=Modelica.Constants.eps) = 1e2 "Maximum value of the capacitance" + annotation (Evaluate=true, Dialog( + enable=use_C_in, + tab="Variable load", + group="Capacitance")); + parameter Boolean use_L_in = false "If true, L is specified by an input" + annotation(Evaluate=true, Dialog(tab = "Variable load", group="Inductance")); + parameter Modelica.Units.SI.Inductance LMin( + start=L, + min=Modelica.Constants.eps) = 1e-4 "Minimum value of the inductance" + annotation (Evaluate=true, Dialog( + enable=use_L_in, + tab="Variable load", + group="Inductance")); + parameter Modelica.Units.SI.Inductance LMax( + start=L, + min=Modelica.Constants.eps) = 1e2 "Maximum value of the inductance" + annotation (Evaluate=true, Dialog( + enable=use_L_in, + tab="Variable load", + group="Inductance")); + Modelica.Blocks.Interfaces.RealInput y_R(min=0, max=1) if use_R_in + "Input that sepecify variable R" + annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=270, + origin={-40,100}))); + Modelica.Blocks.Interfaces.RealInput y_C(min=0, max=1) if use_C_in + "Input that sepecify variable C" + annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=270, + origin={0,100}))); + Modelica.Blocks.Interfaces.RealInput y_L(min=0, max=1) if use_L_in + "Input that sepecify variable L" + annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=270, + origin={40,100}))); +protected + Modelica.Blocks.Interfaces.RealOutput y_R_internal + "Internal signal used to compute the variable R_internal"; + Modelica.Blocks.Interfaces.RealOutput y_C_internal + "Internal signal used to compute the variable C_internal"; + Modelica.Blocks.Interfaces.RealOutput y_L_internal + "Internal signal used to compute the variable L_internal"; + Modelica.Units.SI.Resistance R_internal + "Actual resistance used to compute the impedance"; + Modelica.Units.SI.Inductance L_internal + "Actual inductance used to compute the impedance"; + Modelica.Units.SI.Capacitance C_internal + "Actual capacitance used to compute the impedance"; +equation + // These assertions ensures that if the variable R, L or C is computed using the inputs + // the parameters min and max are sorted + assert((not use_R_in) or RMin < RMax, "The value of RMin has to be lower than RMax"); + assert((not use_L_in) or LMin < LMax, "The value of Lmin has to be lower than Lmax"); + assert((not use_C_in) or CMin < CMax, "The value of Cmin has to be lower than Cmax"); + + // Connections to internal connectors + connect(y_R, y_R_internal); + connect(y_C, y_C_internal); + connect(y_L, y_L_internal); + + // Default assignment when connectors are conditionally removed + if not use_R_in then + y_R_internal = 0; + end if; + + if not use_C_in then + y_C_internal = 0; + end if; + + if not use_L_in then + y_L_internal = 0; + end if; + + // Retrieve the value of the R,L,C either if fixed or + // varying + if not use_R_in then + R_internal = R; + else + R_internal = RMin + y_R_internal*(RMax - RMin); + end if; + + if not use_C_in then + C_internal = C; + else + C_internal = CMin + y_C_internal*(CMax - CMin); + end if; + + if not use_L_in then + L_internal = L; + else + L_internal = LMin + y_L_internal*(LMax - LMin); + end if; + + annotation ( Documentation(info=" +

+This model represents a generalized interface for an impedance. +

+

+The model has a single generalized electric terminal of type + +IBPSA.Electrical.Interfaces.Terminal +that can be redeclared. +The impedance can be of different types: +

+
    +
  1. resistive,
  2. +
  3. inductive,
  4. +
  5. resistive and inductive,
  6. +
  7. capacitive, and
  8. +
  9. resistive and capacitive.
  10. +
+

+The values of the resistance R, capacitance C and +inductance L can be +specified as parameters of the model. +

+

+The values of the resistance R, capacitance C +and inductance L can also be +specified by using the input variables y_R, y_C, +and y_L that are Real values between [0,1].
+These input values are enabled by the boolean flags use_R_in, +use_L_in, and +use_C_in. +

+
Example
+

+If the flag use_R_in = true, the value of R is computed as +

+

+R = Rmin + yR (Rmax - Rmin) +

+", revisions=" + +")); +end Impedance; diff --git a/IBPSA/Electrical/Interfaces/InductiveLoad.mo b/IBPSA/Electrical/Interfaces/InductiveLoad.mo new file mode 100644 index 0000000000..10a6040334 --- /dev/null +++ b/IBPSA/Electrical/Interfaces/InductiveLoad.mo @@ -0,0 +1,68 @@ +within IBPSA.Electrical.Interfaces; +partial model InductiveLoad "Partial model of an inductive load" + extends Load; + parameter Boolean use_pf_in = false "If true, the power factor is defined by an input" + annotation(Dialog(group="Modeling assumption")); + parameter Real pf(min=0, max=1) = 0.8 "Power factor" + annotation(Dialog(group="Nominal conditions")); + Modelica.Blocks.Interfaces.RealInput pf_in( + min=0, + max=1, + unit="1") if (use_pf_in) "Power factor" + annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=180, + origin={100,60}), iconTransformation( + extent={{-20,-20},{20,20}}, + rotation=180, + origin={100,60}))); +protected + function j = PhaseSystem.j "J operator that rotates of 90 degrees"; + Modelica.Blocks.Interfaces.RealInput pf_internal + "Hidden value of the input load for the conditional connector"; + Modelica.Units.SI.MagneticFlux psi[2](each stateSelect=StateSelect.prefer) + "Magnetic flux"; + Modelica.Units.SI.Impedance Z[2] "Impedance of the load"; + Modelica.Units.SI.AngularVelocity omega "Angular frequency"; + Modelica.Units.SI.Power Q=P*tan(acos(pf_internal)) + "Reactive power (positive because inductive load)"; +equation + connect(pf_in, pf_internal); + + if not use_pf_in then + pf_internal = pf; + end if; + + annotation (Documentation(revisions=" + +", info=" +

+This is a model of a generic inductive load. This model is an extension of the base load model + +IBPSA.Electrical.Interfaces.Load. +

+

+This model assumes a fixed power factor pf when the flag use_pf_in = false +otherwise it uses the power factor specified by the input pf_in. +

+

The power factor (either the input or the parameter) is used to compute the reactive power +Q given the active power P +

+

+Q = P tan(arccos(pf)) +

+")); +end InductiveLoad; diff --git a/IBPSA/Electrical/Interfaces/Load.mo b/IBPSA/Electrical/Interfaces/Load.mo new file mode 100644 index 0000000000..54edb9226d --- /dev/null +++ b/IBPSA/Electrical/Interfaces/Load.mo @@ -0,0 +1,256 @@ +within IBPSA.Electrical.Interfaces; +model Load "Partial model for a generic load" + replaceable package PhaseSystem = + IBPSA.Electrical.PhaseSystems.PartialPhaseSystem constrainedby + IBPSA.Electrical.PhaseSystems.PartialPhaseSystem "Phase system" + annotation (choicesAllMatching=true); + parameter Boolean linearized = false "If true, the load model is linearized" + annotation(Evaluate=true,Dialog(group="Modeling assumption")); + parameter IBPSA.Electrical.Types.Load mode( + min=IBPSA.Electrical.Types.Load.FixedZ_steady_state, + max=IBPSA.Electrical.Types.Load.VariableZ_y_input) = IBPSA.Electrical.Types.Load.FixedZ_steady_state + "Type of load model (e.g., steady state, dynamic, prescribed power consumption, etc.)" + annotation (Evaluate=true, Dialog(group="Modeling assumption")); + + parameter Modelica.Units.SI.Power P_nominal=0 + "Nominal power (negative if consumed, positive if generated). Used if mode <> IBPSA.Electrical.Types.Load.VariableZ_P_input" + annotation (Dialog(group="Nominal conditions", enable=mode <> IBPSA.Electrical.Types.Load.VariableZ_P_input)); + + parameter Modelica.Units.SI.Voltage V_nominal(min=0, start=110) + "Nominal voltage (V_nominal >= 0)" annotation (Evaluate=true, Dialog(group= + "Nominal conditions", enable=(mode == IBPSA.Electrical.Types.Load.FixedZ_dynamic + or linearized))); + parameter IBPSA.Electrical.Types.InitMode initMode( + min=IBPSA.Electrical.Types.InitMode.zero_current, + max=IBPSA.Electrical.Types.InitMode.linearized) = IBPSA.Electrical.Types.InitMode.zero_current + "Initialization mode for homotopy operator" annotation(Dialog(tab = "Initialization")); + + Modelica.Units.SI.Voltage v[:](start=PhaseSystem.phaseVoltages(V_nominal)) = + terminal.v "Voltage vector"; + Modelica.Units.SI.Current i[:](each start=0) = terminal.i "Current vector"; + Modelica.Units.SI.Power S[PhaseSystem.n]=PhaseSystem.phasePowers_vi(v, -i) + "Phase powers"; + Modelica.Units.SI.Power P(start=0) + "Power of the load (negative if consumed, positive if fed into the electrical grid)"; + + Modelica.Blocks.Interfaces.RealInput y(min=0, max=1, unit="1") + if (mode == IBPSA.Electrical.Types.Load.VariableZ_y_input) + "Fraction of the nominal power consumed" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=180, + origin={100,0}), iconTransformation( + extent={{-20,-20},{20,20}}, + rotation=180, + origin={100,0}))); + Modelica.Blocks.Interfaces.RealInput Pow(unit="W") + if (mode == IBPSA.Electrical.Types.Load.VariableZ_P_input) + "Power consumed" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=180, + origin={100,0}), iconTransformation( + extent={{-20,-20},{20,20}}, + rotation=180, + origin={100,0}))); + replaceable IBPSA.Electrical.Interfaces.Terminal terminal( + redeclare replaceable package PhaseSystem = PhaseSystem) + "Generalized electric terminal" + annotation (Placement(transformation(extent={{-108,-8},{-92,8}}), + iconTransformation(extent={{-108,-8},{-92,8}}))); + +protected + Modelica.Blocks.Interfaces.RealInput y_internal + "Hidden value of the input load for the conditional connector"; + Modelica.Blocks.Interfaces.RealInput P_internal + "Hidden value of the input power for the conditional connector"; + Real load(min=eps, max=1) + "Internal representation of control signal, used to avoid singularity"; + constant Real eps = 1E-10 + "Small number used to avoid a singularity if the power is zero"; + constant Real oneEps = 1-eps + "Small number used to avoid a singularity if the power is zero"; + +initial equation + if mode == IBPSA.Electrical.Types.Load.VariableZ_P_input then + assert(abs(P_nominal) < 1E-10, "*** Warning: P_nominal = " + String(P_nominal) + ", but this value will be ignored.", + AssertionLevel.warning); + end if; + +equation + assert(y_internal>=0 and y_internal<=1+eps, "The power load fraction P (input of the model) must be within [0,1]"); + + // Connection between the conditional and inner connector + connect(y,y_internal); + connect(Pow,P_internal); + + // If the power is fixed, inner connector value is equal to 1 + if mode==IBPSA.Electrical.Types.Load.FixedZ_steady_state or + mode==IBPSA.Electrical.Types.Load.FixedZ_dynamic then + y_internal = 1; + P_internal = 0; + elseif mode==IBPSA.Electrical.Types.Load.VariableZ_y_input then + P_internal = 0; + elseif mode==IBPSA.Electrical.Types.Load.VariableZ_P_input then + y_internal = 1; + end if; + + // Value of the load, depending on the type: fixed or variable + if mode==IBPSA.Electrical.Types.Load.VariableZ_y_input then + load = eps + oneEps*y_internal; + else + load = 1; + end if; + + // Power consumption + if mode==IBPSA.Electrical.Types.Load.FixedZ_steady_state or + mode==IBPSA.Electrical.Types.Load.FixedZ_dynamic then + P = P_nominal; + elseif mode==IBPSA.Electrical.Types.Load.VariableZ_P_input then + P = P_internal; + else + P = P_nominal*load; + end if; + + annotation ( Documentation(revisions=" + +", info=" +

+This model represents a generic load that can be extended to represent +either a DC or an AC load. +

+

+The model has a single generalized electric terminal of type + +IBPSA.Electrical.Interfaces.Terminal +that can be redeclared. +The generalized load is modeled as an impedance whose value can change. The value of the impedance +can change depending on the value of the parameter mode, which is of type +IBPSA.Electrical.Types.Load: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ModeDescriptionExplanation
IBPSA.Electrical.Types.Load.FixedZ_steady_statefixed Z steady stateThe load consumes exactly the power +specified by the parameter P_nominal. +
IBPSA.Electrical.Types.Load.FixedZ_dynamicfixed Z dynamic +The load consumes exactly the power +specified by the parameter P_nominal at steady state. +Depending on the type +of load (e.g., inductive or capacitive) +different dynamics are represented. +
IBPSA.Electrical.Types.Load.VariableZ_P_inputvariable Z P input +The load consumes exactly the power specified +by the input variable Pow. +
IBPSA.Electrical.Types.Load.VariableZ_y_inputvariable Z y input +The load consumes exactly the a fraction of the nominal power +P_nominal specified by the input variable y. +
+ + +

Conventions

+

+It is assumed that the power P of the load is positive when produced +(e.g., the load acts like a source) and negative when consumed (e.g., the +source acts like a utilizer). +

+ +

Linearized models

+

+The model has a Boolean parameter linearized that by default is equal to false. +When the power consumption of the load is imposed, this introduces +a nonlinear equation between the voltage and the current of the load. This flag is used to +select between a linearized version +of the equations or the original nonlinear ones.
+When the linearized version of the model is used, the parameter V_nominal has to +be specified. The nominal voltage is needed to linearize the nonlinear equations.
+

+

+Note: +A linearized model will not consume the nominal power if the voltage +at the terminal differs from the nominal voltage. +

+ +")); +end Load; diff --git a/IBPSA/Electrical/Interfaces/PartialAcDcParameters.mo b/IBPSA/Electrical/Interfaces/PartialAcDcParameters.mo new file mode 100644 index 0000000000..511f2606f5 --- /dev/null +++ b/IBPSA/Electrical/Interfaces/PartialAcDcParameters.mo @@ -0,0 +1,21 @@ +within IBPSA.Electrical.Interfaces; +record PartialAcDcParameters + "Partial model that contains basic parameters for a DC/AC conversion system" + parameter Real pf(min=0, max=1) = 0.9 "Power factor" + annotation (Dialog(group="AC-Conversion")); + parameter Real eta_DCAC(min=0, max=1) = 0.9 "Efficiency of DC/AC conversion" + annotation (Dialog(group="AC-Conversion")); + annotation (Documentation(info=" +

+This model contains the minimum set of parameters necessary to describe +an AC/DC converter. +

+", revisions=" + +")); +end PartialAcDcParameters; diff --git a/IBPSA/Electrical/Interfaces/PartialBaseTwoPort.mo b/IBPSA/Electrical/Interfaces/PartialBaseTwoPort.mo new file mode 100644 index 0000000000..5ee396713f --- /dev/null +++ b/IBPSA/Electrical/Interfaces/PartialBaseTwoPort.mo @@ -0,0 +1,23 @@ +within IBPSA.Electrical.Interfaces; +model PartialBaseTwoPort "Model of a generic two port component" + + replaceable IBPSA.Electrical.Interfaces.BaseTerminal terminal_n + "Electric terminal side p" + annotation (Placement(transformation(extent={{-108,-8},{-92,8}}))); + replaceable IBPSA.Electrical.Interfaces.BaseTerminal terminal_p + "Electric terminal side n" + annotation (Placement(transformation(extent={{92,-8},{108,8}}))); + + annotation (Documentation(revisions=" + +", info=" +

+This model declares connectors for electrical components with two terminals. +

+")); +end PartialBaseTwoPort; diff --git a/IBPSA/Electrical/Interfaces/PartialConversion.mo b/IBPSA/Electrical/Interfaces/PartialConversion.mo new file mode 100644 index 0000000000..926e91841b --- /dev/null +++ b/IBPSA/Electrical/Interfaces/PartialConversion.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.Interfaces; +model PartialConversion + "Model representing a generic two port system for conversion" + extends IBPSA.Electrical.Interfaces.PartialTwoPort; + Modelica.Units.SI.Voltage v_p "Voltage drop between the two positive pins"; + Modelica.Units.SI.Voltage v_n "Voltage drop between the two negative pins"; + Modelica.Units.SI.Current i_p "Current flowing through the positive pins"; + Modelica.Units.SI.Current i_n "Current flowing through the negative pins"; +equation + i_p = PhaseSystem_p.systemCurrent(terminal_p.i); + i_n = PhaseSystem_n.systemCurrent(terminal_n.i); + + v_p = PhaseSystem_p.systemVoltage(terminal_p.v); + v_n = PhaseSystem_n.systemVoltage(terminal_n.v); + + annotation (Documentation(revisions=" + +", info=" +

+This model extends the base class + +IBPSA.Electrical.Interfaces.PartialTwoPort +model and declares the variables +v_p and i_p that represents the voltage and the +current at the terminal_p, and the variables +v_n and i_n that represents the voltage and the +current at the terminal_n. +These variables are used in conversion models such as transformers and AC/DC converters. +

+")); +end PartialConversion; diff --git a/IBPSA/Electrical/Interfaces/PartialTwoPort.mo b/IBPSA/Electrical/Interfaces/PartialTwoPort.mo new file mode 100644 index 0000000000..3d3fd01df8 --- /dev/null +++ b/IBPSA/Electrical/Interfaces/PartialTwoPort.mo @@ -0,0 +1,39 @@ +within IBPSA.Electrical.Interfaces; +model PartialTwoPort "Model of a generic two port component with phase systems" + + replaceable package PhaseSystem_p = + IBPSA.Electrical.PhaseSystems.PartialPhaseSystem constrainedby + IBPSA.Electrical.PhaseSystems.PartialPhaseSystem + "Phase system of terminal p" + annotation (choicesAllMatching=true); + + replaceable package PhaseSystem_n = + IBPSA.Electrical.PhaseSystems.PartialPhaseSystem constrainedby + IBPSA.Electrical.PhaseSystems.PartialPhaseSystem + "Phase system of terminal n" + annotation (choicesAllMatching=true); + + extends IBPSA.Electrical.Interfaces.PartialBaseTwoPort( + redeclare replaceable IBPSA.Electrical.Interfaces.Terminal + terminal_n(redeclare replaceable package PhaseSystem = PhaseSystem_n), + redeclare replaceable IBPSA.Electrical.Interfaces.Terminal + terminal_p(redeclare replaceable package PhaseSystem=PhaseSystem_p)); + + annotation (Documentation(revisions=" + +", info=" +

+This is a model of a component with two electric terminals. +It represents a common interface that is extended by other models. +

+")); +end PartialTwoPort; diff --git a/IBPSA/Electrical/Interfaces/ResistiveLoad.mo b/IBPSA/Electrical/Interfaces/ResistiveLoad.mo new file mode 100644 index 0000000000..0619d44cbc --- /dev/null +++ b/IBPSA/Electrical/Interfaces/ResistiveLoad.mo @@ -0,0 +1,35 @@ +within IBPSA.Electrical.Interfaces; +partial model ResistiveLoad "Partial model of a resistive load" + extends Load; + + annotation (Documentation(revisions=" + +", info=" +

+This is a model of a generic resistive load. This model is an extension of the base load model + +IBPSA.Electrical.Interfaces.Load. +

+")); +end ResistiveLoad; diff --git a/IBPSA/Electrical/Interfaces/Source.mo b/IBPSA/Electrical/Interfaces/Source.mo new file mode 100644 index 0000000000..a7f6e4f839 --- /dev/null +++ b/IBPSA/Electrical/Interfaces/Source.mo @@ -0,0 +1,71 @@ +within IBPSA.Electrical.Interfaces; +model Source "Partial model of a generic source." + replaceable package PhaseSystem = + IBPSA.Electrical.PhaseSystems.OnePhase constrainedby + IBPSA.Electrical.PhaseSystems.PartialPhaseSystem "Phase system" + annotation (choicesAllMatching=true); + parameter Boolean potentialReference = true + "Serve as potential root for the reference angle theta" + annotation (Evaluate=true, Dialog(group="Reference Parameters")); + parameter Boolean definiteReference = false + "Serve as definite root for the reference angle theta" + annotation (Evaluate=true, Dialog(group="Reference Parameters")); + Modelica.Units.SI.Power S[PhaseSystem.n]=PhaseSystem.phasePowers_vi(terminal.v, + terminal.i) "Complex power S[1] = P, S[2]= Q"; + Modelica.Units.SI.Angle phi=PhaseSystem.phase(terminal.v) - PhaseSystem.phase( + -terminal.i) "Phase shift with respect to reference angle"; + replaceable IBPSA.Electrical.Interfaces.Terminal terminal( + redeclare final replaceable package PhaseSystem = PhaseSystem) + "Generalized terminal" + annotation (Placement(transformation(extent={{92,-8},{108,8}}))); +protected + function j = PhaseSystem.j; +equation + if potentialReference then + if definiteReference then + Connections.root(terminal.theta); + else + Connections.potentialRoot(terminal.theta); + end if; + end if; + annotation ( Documentation(revisions=" + +", info=" +

+This model represents a generic source. +

+

+In case the phase system has PhaseSystem.m > 0 and +thus the connectors are over determined, +the source can be selected to serve as reference point. +The parameters potentialReference and definiteReference +are used to define if the source model should be selected as source for +the reference angles theta or not. +More information about overdetermined connectors can be found +in Olsson Et Al. (2008). +

+ +

References

+

+ +Hans Olsson, Martin Otter, Sven Erik Mattson and Hilding Elmqvist.
+
+Balanced Models in Modelica 3.0 for Increased Model Quality.
+Proc. of the 7th Modelica Conference, Bielefeld, Germany, March 2008. +

+")); +end Source; diff --git a/IBPSA/Electrical/Interfaces/Terminal.mo b/IBPSA/Electrical/Interfaces/Terminal.mo new file mode 100644 index 0000000000..53989a124f --- /dev/null +++ b/IBPSA/Electrical/Interfaces/Terminal.mo @@ -0,0 +1,79 @@ +within IBPSA.Electrical.Interfaces; +connector Terminal "Generalized electric terminal" + extends IBPSA.Electrical.Interfaces.BaseTerminal; +replaceable package PhaseSystem = PhaseSystems.PartialPhaseSystem + "Phase system" + annotation (choicesAllMatching=true); +PhaseSystem.Voltage v[PhaseSystem.n] "Voltage vector"; +flow PhaseSystem.Current i[PhaseSystem.n](each start=0) "Current vector"; +PhaseSystem.ReferenceAngle theta[PhaseSystem.m] + "Optional vector of phase angles"; + annotation (Documentation(revisions=" + +", info=" +

+This connector represents a generalized electric terminal. The generalization is made possible by the +replaceable package +IBPSA.Electrical.Interfaces.Terminal.PhaseSystem. +The package PhaseSystem can be one of the packages contained in + +IBPSA.Electrical.PhaseSystems. +Using this approach allows to represent DC, single phase AC and +multi phases balanced and unbalanced AC systems with the same connector. +

+

+This connector is compatible with the following Modelica libraries: +

+ +

+The connector is overdetermined since the number of effort variables +is higher than the number of flow variables. +This happens when the phase system has a number of reference angles +PhaseSystem.m > 0. +The over-determined connectors are defined and used in such a way +that a Modelica tool is able +to remove the superfluous but consistent equations arriving +at a balanced set of equations, based on a +graph analysis of the connection structure. +The models have to use ad-hoc constructs specified by the Modelica language to handle this situation. +More information can be found in Olsson Et Al. (2008). +

+

+More details about the generalized electrical terminal +can be found in Franke and Wiesmann (2014). +

+

References

+

+ +Hans Olsson, Martin Otter, Sven Erik Mattson and Hilding Elmqvist.
+
+Balanced Models in Modelica 3.0 for Increased Model Quality.
+Proc. of the 7th Modelica Conference, Bielefeld, Germany, March 2008.
+

+

+ +Ruediger Franke and Hansjurg Wiesmann.
+
+Flexible modeling of electrical power systems - the Modelica PowerSystems library.
+Proc. of the 10th Modelica Conference, Lund, Sweden, March 2014. +

+")); +end Terminal; diff --git a/IBPSA/Electrical/Interfaces/VariableVoltageSource.mo b/IBPSA/Electrical/Interfaces/VariableVoltageSource.mo new file mode 100644 index 0000000000..21d689680b --- /dev/null +++ b/IBPSA/Electrical/Interfaces/VariableVoltageSource.mo @@ -0,0 +1,63 @@ +within IBPSA.Electrical.Interfaces; +model VariableVoltageSource + "Partial model of a generic variable voltage source." + extends IBPSA.Electrical.Interfaces.Source; + parameter Boolean use_V_in = true "If true, the voltage is an input"; + parameter Modelica.Units.SI.Voltage V=1 "Value of constant voltage" + annotation (Dialog(enable=not use_V_in)); + Modelica.Blocks.Interfaces.RealInput V_in(unit="V", min=0, start = 1) + if use_V_in "Input voltage" + annotation (Placement(transformation( + extent={{20,-20},{-20,20}}, + rotation=180, + origin={-100,60}), + iconTransformation( + extent={{20,-20},{-20,20}}, + rotation=180, + origin={-100,60}))); +protected + Modelica.Blocks.Interfaces.RealInput V_in_internal(unit="V") + "Hidden value of the input voltage for the conditional connector"; +equation + + // Connection between the conditional and inner connector + connect(V_in,V_in_internal); + + // If the voltage is fixed, inner connector value is equal to parameter V + if use_V_in == false then + V_in_internal = V; + end if; + annotation ( Documentation(revisions=" + +", info=" +

+This model represents a generic variable voltage source. The model has a boolean +flag use_V_in, when this flag is equal to true +the voltage of the source is imposed by the input variable V_in. +When the flag is equal to false the voltage source is equal to the parameter V. +

+

+In case the phase system adopted has PhaseSystem.m > 0 and +thus the connectors are over determined, +the source can be selected to serve as reference point. +The parameters potentialReference and definiteReference are used to define if the +source model should be selected as source for the reference angles or not. +More information about overdetermined connectors can be found +in Olsson Et Al. (2008). +

+ +

References

+

+ +Hans Olsson, Martin Otter, Sven Erik Mattson and Hilding Elmqvist.
+
+Balanced Models in Modelica 3.0 for Increased Model Quality.
+Proc. of the 7th Modelica Conference, Bielefeld, Germany, March 2008. +

+")); +end VariableVoltageSource; diff --git a/IBPSA/Electrical/Interfaces/package.mo b/IBPSA/Electrical/Interfaces/package.mo new file mode 100644 index 0000000000..44d89cfb60 --- /dev/null +++ b/IBPSA/Electrical/Interfaces/package.mo @@ -0,0 +1,22 @@ +within IBPSA.Electrical; +package Interfaces "This package contains interfaces and partial models that are inherited by other components" + extends Modelica.Icons.InterfacesPackage; + + +annotation (preferredView="info", Documentation(info=" +

+This package contains basic classes that are used to build +component models for electrical systems. +The classes are not directly usable, but can +be extended when building a new model. +

+", +revisions=" + +")); +end Interfaces; diff --git a/IBPSA/Electrical/Interfaces/package.order b/IBPSA/Electrical/Interfaces/package.order new file mode 100644 index 0000000000..e5ab5b20e2 --- /dev/null +++ b/IBPSA/Electrical/Interfaces/package.order @@ -0,0 +1,14 @@ +BaseTerminal +CapacitiveLoad +Ground +Impedance +InductiveLoad +Load +PartialBaseTwoPort +PartialConversion +PartialTwoPort +ResistiveLoad +Source +Terminal +VariableVoltageSource +PartialAcDcParameters diff --git a/IBPSA/Electrical/PVSystem/package.mo b/IBPSA/Electrical/PVSystem/package.mo index 59416cfc39..7e0dd97cd1 100644 --- a/IBPSA/Electrical/PVSystem/package.mo +++ b/IBPSA/Electrical/PVSystem/package.mo @@ -1,4 +1,4 @@ within IBPSA.Electrical; package PVSystem - + end PVSystem; diff --git a/IBPSA/Electrical/PhaseSystems/DirectCurrent.mo b/IBPSA/Electrical/PhaseSystems/DirectCurrent.mo new file mode 100644 index 0000000000..9d5dee23a0 --- /dev/null +++ b/IBPSA/Electrical/PhaseSystems/DirectCurrent.mo @@ -0,0 +1,107 @@ +within IBPSA.Electrical.PhaseSystems; +package DirectCurrent "DC system" + extends PartialPhaseSystem(phaseSystemName="DirectCurrent", n=1, m=0); + + + redeclare function extends j "Direct current has no complex component" + algorithm + y := zeros(n); + annotation(Inline=true); + end j; + + + redeclare function extends rotate + "Rotate a vector of an angle theta (anti-counterclock)" + algorithm + y[n] := x[n]; + annotation(Inline=true); + end rotate; + + + redeclare function extends thetaRel + "Return absolute angle of rotating system as offset to thetaRef" + algorithm + thetaRel := 0; + annotation(Inline=true); + end thetaRel; + + + redeclare function extends thetaRef + "Return absolute angle of rotating reference system" + algorithm + thetaRef := 0; + annotation(Inline=true); + end thetaRef; + + + redeclare function extends phase "Return phase" + algorithm + phase := 0; + annotation(Inline=true); + end phase; + + + redeclare replaceable function extends phaseVoltages + "Return phase to neutral voltages" + algorithm + v := {V}; + annotation(Inline=true); + end phaseVoltages; + + + redeclare function extends phaseCurrents "Return phase currents" + algorithm + i := {I}; + annotation(Inline=true); + end phaseCurrents; + + + redeclare function extends phasePowers "Return phase powers" + algorithm + p := {P}; + annotation(Inline=true); + end phasePowers; + + + redeclare function extends phasePowers_vi "Return phase powers" + algorithm + p := {v*i}; + annotation(Inline=true); + end phasePowers_vi; + + + redeclare replaceable function extends systemVoltage + "Return system voltage as function of phase voltages" + algorithm + V := v[1]; + annotation(Inline=true); + end systemVoltage; + + + redeclare function extends systemCurrent + "Return system current as function of phase currents" + algorithm + I := i[1]; + annotation(Inline=true); + end systemCurrent; + + + redeclare function extends activePower + "Return total power as function of phase powers" + algorithm + P := v*i; + annotation(Inline=true); + end activePower; + + + annotation (Icon(graphics={Line( + points={{-70,-10},{50,-10}}, + color={95,95,95}, + smooth=Smooth.None)}), +Documentation(info=" +

+This package declares the functions that are used to implement +the DC models. +

+")); +end DirectCurrent; diff --git a/IBPSA/Electrical/PhaseSystems/OnePhase.mo b/IBPSA/Electrical/PhaseSystems/OnePhase.mo new file mode 100644 index 0000000000..d769b95785 --- /dev/null +++ b/IBPSA/Electrical/PhaseSystems/OnePhase.mo @@ -0,0 +1,125 @@ +within IBPSA.Electrical.PhaseSystems; +package OnePhase "Single phase two connectors AC system" + extends PartialPhaseSystem(phaseSystemName="OnePhase", n=2, m=1); + + + redeclare function extends j "Return vector rotated by 90 degrees" + algorithm + y := {-x[2], x[1]}; + annotation(Inline=true); + end j; + + + redeclare function extends rotate + "Rotate a vector of an angle theta (anti-counterclock)" + algorithm + y[1] := cos(theta)*x[1] - sin(theta)*x[2]; + y[2] := sin(theta)*x[1] + cos(theta)*x[2]; + annotation(Inline=true); + end rotate; + + + redeclare function extends product + "Multiply two complex numbers represented by vectors x[2] and y[2]" + algorithm + z := {x[1]*y[1] - x[2]*y[2], x[1]*y[2] + x[2]*y[1]}; + annotation(Inline=true); + end product; + + + redeclare function extends divide + "Divide two complex numbers represented by vectors x[2] and y[2]" + algorithm + z := {x[1]*y[1] + x[2]*y[2], x[2]*y[1] - x[1]*y[2]}/(y[1]^2 + y[2]^2); + annotation(Inline=true); + end divide; + + + redeclare function extends thetaRel + "Return absolute angle of rotating system as offset to thetaRef" + algorithm + thetaRel := 0; + annotation(Inline=true); + end thetaRel; + + + redeclare function extends thetaRef + "Return absolute angle of rotating reference system" + algorithm + thetaRef := theta[1]; + annotation(Inline=true); + end thetaRef; + + + redeclare function extends phase "Return phase" + algorithm + phase := atan2(x[2], x[1]); + annotation(Inline=true); + end phase; + + + redeclare function extends phaseVoltages "Return phase to neutral voltages" + algorithm + v := {V*cos(phi), V*sin(phi)}; + annotation(Inline=true); + end phaseVoltages; + + + redeclare function extends phaseCurrents "Return phase currents" + algorithm + i := {I*cos(phi), I*sin(phi)}; + annotation(Inline=true); + end phaseCurrents; + + + redeclare function extends phasePowers "Return phase powers" + algorithm + p := {P, P*tan(phi)}; + annotation(Inline=true); + end phasePowers; + + + redeclare function extends phasePowers_vi "Return phase powers" + algorithm + p := {v[1]*i[1] + v[2]*i[2], v[2]*i[1] - v[1]*i[2]}; + annotation(Inline=true); + end phasePowers_vi; + + + redeclare function extends systemVoltage + "Return system voltage as function of phase voltages" + algorithm + V := Modelica.Fluid.Utilities.regRoot(v*v, delta = 1e-5); + annotation(Inline=true); + end systemVoltage; + + + redeclare function extends systemCurrent + "Return system current as function of phase currents" + algorithm + I := Modelica.Fluid.Utilities.regRoot(i*i, delta = 1e-5); + annotation(Inline=true); + end systemCurrent; + + + redeclare function extends activePower + "Return total power as function of phase powers" + algorithm + // P = v[1]*i[1] + v[2]*i[2] + P := v*i; + annotation(Inline=true); + end activePower; + + + annotation (Icon(graphics={ + Line( + points={{-70,-10},{-58,10},{-38,30},{-22,10},{-10,-10},{2,-30},{22,-50}, + {40,-30},{50,-10}}, + color={95,95,95}, + smooth=Smooth.Bezier)}), Documentation(info=" +

+This package declares the functions that are used to implement +the AC single phase models. +

+")); +end OnePhase; diff --git a/IBPSA/Electrical/PhaseSystems/PartialPhaseSystem.mo b/IBPSA/Electrical/PhaseSystems/PartialPhaseSystem.mo new file mode 100644 index 0000000000..bb566679ce --- /dev/null +++ b/IBPSA/Electrical/PhaseSystems/PartialPhaseSystem.mo @@ -0,0 +1,160 @@ +within IBPSA.Electrical.PhaseSystems; +package PartialPhaseSystem "Base package of all phase systems" + extends Modelica.Icons.Package; + constant String phaseSystemName = "UnspecifiedPhaseSystem" + "Name of the phase system represented by the package"; + constant Integer n "Number of independent voltage and current components"; + constant Integer m "Number of reference angles"; + + type Current = Real(unit = "A", quantity = "Current." + phaseSystemName) + "Current for connector" annotation (Documentation(info=" +This type defines the current for a specific connector that extends + +IBPSA.Electrical.PhaseSystems.PartialPhaseSystem. +")); + + type Voltage = Real(unit = "V", quantity = "Voltage." + phaseSystemName) + "Voltage for connector" annotation (Documentation(info=" +This type defines the voltage for a specific connector that extends + +IBPSA.Electrical.PhaseSystems.PartialPhaseSystem. +")); + + type ReferenceAngle "Reference angle for connector" + extends Modelica.Units.SI.Angle; + + function equalityConstraint "Assert that angles are equal" + extends Modelica.Icons.Function; + input ReferenceAngle theta1[:]; + input ReferenceAngle theta2[:]; + output Real residue[0]; + algorithm + for i in 1:size(theta1, 1) loop + assert(abs(theta1[i] - theta2[i]) < Modelica.Constants.eps, + "Angles theta1 and theta2 are not equal over the connection."); + end for; + end equalityConstraint; + annotation (Documentation(info=" +This type defines the voltage angle (used by the phasorial approach) for a specific connector that extends + +IBPSA.Electrical.PhaseSystems.PartialPhaseSystem. +")); + end ReferenceAngle; + + replaceable partial function j "Return vector rotated by 90 degrees" + extends Modelica.Icons.Function; + input Real x[n]; + output Real y[n]; + end j; + + replaceable partial function jj "Vectorized version of j" + extends Modelica.Icons.Function; + input Real[:,:] xx "array of voltage or current vectors"; + output Real[size(xx,1),size(xx,2)] yy "array of rotated vectors"; + algorithm + //yy := {j(xx[:,k]) for k in 1:size(xx,2)}; + // Note: Dymola 2013 fails to expand + for k in 1:size(xx,2) loop + yy[:,k] := j(xx[:,k]); + end for; + end jj; + + replaceable partial function rotate + "Rotate a vector of an angle theta (anti-counterclock)" + extends Modelica.Icons.Function; + input Real x[n]; + input Modelica.Units.SI.Angle theta; + output Real y[n]; + end rotate; + + replaceable partial function product "Multiply two vectors" + extends Modelica.Icons.Function; + input Real x[n]; + input Real y[n]; + output Real z[n]; + end product; + + replaceable partial function divide "Divide two vectors" + extends Modelica.Icons.Function; + input Real x[n]; + input Real y[n]; + output Real z[n]; + end divide; + + replaceable partial function thetaRel + "Return absolute angle of rotating system as offset to thetaRef" + extends Modelica.Icons.Function; + input Modelica.Units.SI.Angle theta[m]; + output Modelica.Units.SI.Angle thetaRel; + end thetaRel; + + replaceable partial function thetaRef + "Return absolute angle of rotating reference system" + extends Modelica.Icons.Function; + input Modelica.Units.SI.Angle theta[m]; + output Modelica.Units.SI.Angle thetaRef; + end thetaRef; + + replaceable partial function phase "Return phase" + extends Modelica.Icons.Function; + input Real x[n]; + output Modelica.Units.SI.Angle phase; + end phase; + + replaceable partial function phaseVoltages "Return phase to neutral voltages" + extends Modelica.Icons.Function; + input Modelica.Units.SI.Voltage V "system voltage"; + input Modelica.Units.SI.Angle phi=0 "phase angle"; + output Modelica.Units.SI.Voltage v[n] "phase to neutral voltages"; + end phaseVoltages; + + replaceable partial function phaseCurrents "Return phase currents" + extends Modelica.Icons.Function; + input Modelica.Units.SI.Current I "system current"; + input Modelica.Units.SI.Angle phi=0 "phase angle"; + output Modelica.Units.SI.Current i[n] "phase currents"; + end phaseCurrents; + + replaceable partial function phasePowers "Return phase powers" + extends Modelica.Icons.Function; + input Modelica.Units.SI.ActivePower P "active system power"; + input Modelica.Units.SI.Angle phi=0 "phase angle"; + output Modelica.Units.SI.Power p[n] "phase powers"; + end phasePowers; + + replaceable partial function phasePowers_vi "Return phase powers" + extends Modelica.Icons.Function; + input Modelica.Units.SI.Voltage v[n] "phase voltages"; + input Modelica.Units.SI.Current i[n] "phase currents"; + output Modelica.Units.SI.Power p[n] "phase powers"; + end phasePowers_vi; + + replaceable partial function systemVoltage + "Return system voltage as function of phase voltages" + extends Modelica.Icons.Function; + input Modelica.Units.SI.Voltage v[n]; + output Modelica.Units.SI.Voltage V; + end systemVoltage; + + replaceable partial function systemCurrent + "Return system current as function of phase currents" + extends Modelica.Icons.Function; + input Modelica.Units.SI.Current i[n]; + output Modelica.Units.SI.Current I; + end systemCurrent; + + replaceable partial function activePower + "Return total power as function of phase powers" + extends Modelica.Icons.Function; + input Modelica.Units.SI.Voltage v[n] "phase voltages"; + input Modelica.Units.SI.Current i[n] "phase currents"; + output Modelica.Units.SI.ActivePower P "active system power"; + end activePower; + +annotation (Documentation(info=" +

+This package declares the functions that are used to implement +the different phase systems. +

+")); +end PartialPhaseSystem; diff --git a/IBPSA/Electrical/PhaseSystems/ThreePhase_d.mo b/IBPSA/Electrical/PhaseSystems/ThreePhase_d.mo new file mode 100644 index 0000000000..a39764423e --- /dev/null +++ b/IBPSA/Electrical/PhaseSystems/ThreePhase_d.mo @@ -0,0 +1,37 @@ +within IBPSA.Electrical.PhaseSystems; +package ThreePhase_d "AC system covering only resistive loads with three symmetric phases" + extends DirectCurrent(phaseSystemName="ThreePhase_d"); + + + redeclare function phaseVoltages "Return phase to neutral voltages" + extends Modelica.Icons.Function; + input SI.Voltage V "system voltage"; + input SI.Angle phi = 0 "phase angle"; + output SI.Voltage v[n] "phase to neutral voltages"; + algorithm + v := {V}/sqrt(3); + end phaseVoltages; + + + redeclare function systemVoltage + "Return system voltage as function of phase voltages" + extends Modelica.Icons.Function; + input SI.Voltage v[n]; + output SI.Voltage V; + algorithm + V := sqrt(3)*v[1]; + end systemVoltage; + + + annotation (Icon(graphics={ + Line( + points={{-70,-10},{-58,10},{-38,30},{-22,10},{-10,-10},{2,-30},{22, + -50},{40,-30},{50,-10}}, + color={95,95,95}, + smooth=Smooth.Bezier)}), Documentation(info=" +

+This package declares the functions that are used to implement +the AC three-phase balanced and purely resistive models. +

+")); +end ThreePhase_d; diff --git a/IBPSA/Electrical/PhaseSystems/ThreePhase_dq.mo b/IBPSA/Electrical/PhaseSystems/ThreePhase_dq.mo new file mode 100644 index 0000000000..45d31b770f --- /dev/null +++ b/IBPSA/Electrical/PhaseSystems/ThreePhase_dq.mo @@ -0,0 +1,107 @@ +within IBPSA.Electrical.PhaseSystems; +package ThreePhase_dq "AC system, symmetrically loaded three-phase" + extends PartialPhaseSystem(phaseSystemName="ThreePhase_dq", n=2, m=1); + + + redeclare function extends j "Return vector rotated by 90 degrees" + algorithm + y := {-x[2], x[1]}; + annotation(Inline=true); + end j; + + + redeclare function extends thetaRel + "Return absolute angle of rotating system as offset to thetaRef" + algorithm + thetaRel := 0; + annotation(Inline=true); + end thetaRel; + + + redeclare function extends thetaRef + "Return absolute angle of rotating reference system" + algorithm + thetaRef := theta[1]; + annotation(Inline=true); + end thetaRef; + + + redeclare function extends phase "Return phase" + algorithm + phase := atan2(x[2], x[1]); + annotation(Inline=true); + end phase; + + + redeclare function extends phaseVoltages "Return phase to neutral voltages" + algorithm + v := {V*cos(phi), V*sin(phi)}/sqrt(3); + annotation(Inline=true); + end phaseVoltages; + + + redeclare function extends phaseCurrents "Return phase currents" + algorithm + i := {I*cos(phi), I*sin(phi)}; + annotation(Inline=true); + end phaseCurrents; + + + redeclare function extends phasePowers "Return phase powers" + algorithm + p := {P, P*tan(phi)}; + annotation(Inline=true); + end phasePowers; + + + redeclare function extends phasePowers_vi "Return phase powers" + algorithm + p := {v*i, -j(v)*i}; + annotation(Inline=true); + end phasePowers_vi; + + + redeclare function extends systemVoltage + "Return system voltage as function of phase voltages" + algorithm + V := Modelica.Fluid.Utilities.regRoot(3*v*v, delta = 1e-5); + annotation(Inline=true); + end systemVoltage; + + + redeclare function extends systemCurrent + "Return system current as function of phase currents" + algorithm + I := Modelica.Fluid.Utilities.regRoot(i*i, delta = 1e-5); + annotation(Inline=true); + end systemCurrent; + + + redeclare function extends activePower + "Return total power as function of phase powers" + algorithm + P := v[1]*i[1]; + annotation(Inline=true); + end activePower; + + + annotation (Icon(graphics={ + Line( + points={{-70,12},{-58,32},{-38,52},{-22,32},{-10,12},{2,-8},{22,-28}, + {40,-8},{50,12}}, + color={95,95,95}, + smooth=Smooth.Bezier), + Line( + points={{-70,-70},{50,-70}}, + color={95,95,95}, + smooth=Smooth.None), + Line( + points={{-70,-46},{50,-46}}, + color={95,95,95}, + smooth=Smooth.None)}), Documentation(info=" +

+This package declares the functions that are used to implement +the AC three-phase balanced models using the DQ representation. +

+")); +end ThreePhase_dq; diff --git a/IBPSA/Electrical/PhaseSystems/ThreePhase_dq0.mo b/IBPSA/Electrical/PhaseSystems/ThreePhase_dq0.mo new file mode 100644 index 0000000000..bde728c3ce --- /dev/null +++ b/IBPSA/Electrical/PhaseSystems/ThreePhase_dq0.mo @@ -0,0 +1,134 @@ +within IBPSA.Electrical.PhaseSystems; +package ThreePhase_dq0 "AC system in dqo representation" + extends PartialPhaseSystem(phaseSystemName="ThreePhase_dqo", n=3, m=2); + + + redeclare function extends j + "Rotation(pi/2) of vector around {0,0,1} and projection on North plane" + algorithm + y := cat(1, {-x[2], x[1]}, zeros(size(x,1)-2)); + annotation(Inline=true); + end j; + + + redeclare function extends rotate + "Rotate a vector of an angle theta (anti-counterclock)" + algorithm + y[1] := cos(theta)*x[1] - sin(theta)*x[2]; + y[2] := sin(theta)*x[1] + cos(theta)*x[2]; + y[3] := x[3]; + annotation(Inline=true); + end rotate; + + + redeclare function jj "Vectorized version of j" + extends Modelica.Icons.Function; + input Real[:,:] xx "array of voltage or current vectors"; + output Real[size(xx,1),size(xx,2)] yy "array of rotated vectors"; + algorithm + yy := cat(1, {-xx[2,:], xx[1,:]}, zeros(size(xx,1)-2, size(xx,2))); + annotation(Inline=true); + end jj; + + + redeclare function extends thetaRel + "Return absolute angle of rotating system as offset to thetaRef" + algorithm + thetaRel := theta[1]; + annotation(Inline=true); + end thetaRel; + + + redeclare function extends thetaRef + "Return absolute angle of rotating reference system" + algorithm + thetaRef := theta[2]; + annotation(Inline=true); + end thetaRef; + + + redeclare function extends phase "Return phase" + algorithm + phase := atan2(x[2], x[1]); + annotation(Inline=true); + end phase; + + + redeclare function extends phaseVoltages "Return phase to neutral voltages" + protected + Voltage neutral_v = 0; + algorithm + v := {V*cos(phi), V*sin(phi), sqrt(3)*neutral_v}/sqrt(3); + annotation(Inline=true); + end phaseVoltages; + + + redeclare function extends phaseCurrents "Return phase currents" + algorithm + i := {I*cos(phi), I*sin(phi), 0}; + annotation(Inline=true); + end phaseCurrents; + + + redeclare function extends phasePowers "Return phase powers" + algorithm + p := {P, P*tan(phi), 0}; + annotation(Inline=true); + end phasePowers; + + + redeclare function extends phasePowers_vi "Return phase powers" + algorithm + p := {v[1:2]*i[1:2], -j(v[1:2])*i[1:2], v[3]*i[3]}; + annotation(Inline=true); + end phasePowers_vi; + + + redeclare function extends systemVoltage + "Return system voltage as function of phase voltages" + algorithm + V := Modelica.Fluid.Utilities.regRoot(v*v, delta = 1e-5); + annotation(Inline=true); + end systemVoltage; + + + redeclare function extends systemCurrent + "Return system current as function of phase currents" + algorithm + I := Modelica.Fluid.Utilities.regRoot(i*i, delta = 1e-5); + annotation(Inline=true); + end systemCurrent; + + + redeclare function extends activePower + "Return total power as function of phase powers" + algorithm + P := v[1]*i[1]; + annotation(Inline=true); + end activePower; + + + annotation (Icon(graphics={ + Line( + points={{-70,28},{-58,48},{-38,68},{-22,48},{-10,28},{2,8},{22,-12}, + {40,8},{50,28}}, + color={95,95,95}, + smooth=Smooth.Bezier), + Line( + points={{-70,-54},{50,-54}}, + color={95,95,95}, + smooth=Smooth.None), + Line( + points={{-70,-78},{50,-78}}, + color={95,95,95}, + smooth=Smooth.None), + Line( + points={{-70,-28},{50,-28}}, + color={95,95,95}, + smooth=Smooth.None)}), Documentation(info=" +

+This package declares the functions that are used to implement +the AC three-phase balanced models using the DQ0 representation. +

+")); +end ThreePhase_dq0; diff --git a/IBPSA/Electrical/PhaseSystems/TwoConductor.mo b/IBPSA/Electrical/PhaseSystems/TwoConductor.mo new file mode 100644 index 0000000000..526d119663 --- /dev/null +++ b/IBPSA/Electrical/PhaseSystems/TwoConductor.mo @@ -0,0 +1,110 @@ +within IBPSA.Electrical.PhaseSystems; +package TwoConductor "Two conductors for DC components" + extends PartialPhaseSystem(phaseSystemName="TwoConductor", n=2, m=0); + + + redeclare function extends j "Direct current has no complex component" + algorithm + y := zeros(n); + annotation(Inline=true); + end j; + + + redeclare function extends rotate + "Rotate a vector of an angle theta (anti-counterclock)" + algorithm + y[n] := x[n]; + annotation(Inline=true); + end rotate; + + + redeclare function extends thetaRel + "Return absolute angle of rotating system as offset to thetaRef" + algorithm + thetaRel := 0; + annotation(Inline=true); + end thetaRel; + + + redeclare function extends thetaRef + "Return absolute angle of rotating reference system" + algorithm + thetaRef := 0; + annotation(Inline=true); + end thetaRef; + + + redeclare function extends phase "Return phase" + algorithm + phase := 0; + annotation(Inline=true); + end phase; + + + redeclare replaceable function extends phaseVoltages + "Return phase to neutral voltages" + algorithm + v := 0.5*{V, -V}; + annotation(Inline=true); + end phaseVoltages; + + + redeclare function extends phaseCurrents "Return phase currents" + algorithm + i := {I, -I}; + annotation(Inline=true); + end phaseCurrents; + + + redeclare function extends phasePowers "Return phase powers" + algorithm + p := {P, 0}; + annotation(Inline=true); + end phasePowers; + + + redeclare function extends phasePowers_vi "Return phase powers" + algorithm + p := v.*i; + annotation(Inline=true); + end phasePowers_vi; + + + redeclare replaceable function extends systemVoltage + "Return system voltage as function of phase voltages" + algorithm + V := v[1] - v[2]; + annotation(Inline=true); + end systemVoltage; + + + redeclare function extends systemCurrent + "Return system current as function of phase currents" + algorithm + I := (i[1] - i[2])/2; + annotation(Inline=true); + end systemCurrent; + + + redeclare function extends activePower + "Return total power as function of phase powers" + algorithm + P := v*i; + annotation(Inline=true); + end activePower; + + + annotation (Icon(graphics={Line( + points={{-70,-28},{50,-28}}, + color={95,95,95}, + smooth=Smooth.None), + Line( + points={{-70,6},{50,6}}, + color={95,95,95}, + smooth=Smooth.None)}), Documentation(info=" +

+This package declares the functions that are used to implement +the DC models with double conductors. +

+")); +end TwoConductor; diff --git a/IBPSA/Electrical/PhaseSystems/package.mo b/IBPSA/Electrical/PhaseSystems/package.mo new file mode 100644 index 0000000000..c7e2603264 --- /dev/null +++ b/IBPSA/Electrical/PhaseSystems/package.mo @@ -0,0 +1,72 @@ +within IBPSA.Electrical; +package PhaseSystems "Phase systems used in power connectors" + extends Modelica.Icons.Package; + import Modelica.Units.SI; + import Modelica.Constants.pi; + + + annotation (Icon(graphics={Line( + points={{-70,-52},{50,-52}}, + color={95,95,95}, + smooth=Smooth.None), Line( + points={{-70,8},{-58,28},{-38,48},{-22,28},{-10,8},{2,-12},{22,-32},{ + 40,-12},{50,8}}, + color={95,95,95}, + smooth=Smooth.Bezier)}), +preferredView="info", +Documentation(info=" +

+This package contains a list of packages that represent different type of electric systems. +Each package inherits from +Buildings.Electrical.PhaseSystems.PartialPhaseSystem. +

+

+The packages represent various types of electrical systems. The basic idea behind this +approach is to use the same connector for different electrical domains. +Each connector has a replaceable package that inherits from + +Buildings.Electrical.PhaseSystems.PartialPhaseSystem +depending on the type of electrical system. +The electrical systems represented are: +

+ + + +

+This approach has been used by the following Modelica libraries: +

+ + + +

+More details about the phase system packages can be found in Franke and Wiesmann (2014). +

+

References

+

+ +Ruediger Franke and Hansjurg Wiesmann.
+
+Flexible modeling of electrical power systems - the Modelica PowerSystems library.
+Proc. of the 10th Modelica Conference, Lund, Sweden, March 2014. +

+", revisions=" + +")); +end PhaseSystems; diff --git a/IBPSA/Electrical/PhaseSystems/package.order b/IBPSA/Electrical/PhaseSystems/package.order new file mode 100644 index 0000000000..d1d8938c49 --- /dev/null +++ b/IBPSA/Electrical/PhaseSystems/package.order @@ -0,0 +1,7 @@ +DirectCurrent +OnePhase +PartialPhaseSystem +ThreePhase_d +ThreePhase_dq +ThreePhase_dq0 +TwoConductor diff --git a/IBPSA/Electrical/Transmission/BaseClasses/BaseCable.mo b/IBPSA/Electrical/Transmission/BaseClasses/BaseCable.mo new file mode 100644 index 0000000000..97885e5459 --- /dev/null +++ b/IBPSA/Electrical/Transmission/BaseClasses/BaseCable.mo @@ -0,0 +1,101 @@ +within IBPSA.Electrical.Transmission.BaseClasses; +record BaseCable "Record that contains the properties of a generic cable" + parameter IBPSA.Electrical.Transmission.Types.Material material = IBPSA.Electrical.Transmission.Types.Material.Al + "Material of the cable"; + parameter Modelica.Units.SI.Current Amp(start=0.0) = 0.0 + "Ampacitance of the cable"; + parameter Modelica.Units.SI.Temperature T_ref=298.15 + "Reference cable temperature"; + parameter Modelica.Units.SI.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.Units.SI.Length l "Length of the cable"; + input Modelica.Units.SI.Frequency f=50 + "Frequency considered in the definition of cables properties"; + output Modelica.Units.SI.Resistance R "Resistance of the cable"; + protected + parameter Modelica.Units.SI.AngularVelocity omega=2*Modelica.Constants.pi*f; + annotation (Documentation(revisions=" + +")); + end lineResistance; + + replaceable partial function lineInductance + "Function that computes the inductance of a cable" + extends Modelica.Icons.Function; + input Modelica.Units.SI.Length l "Length of the cable"; + input Modelica.Units.SI.Frequency f=50 + "Frequency considered in the definition of cables properties"; + output Modelica.Units.SI.Inductance L "Inductance of the cable"; + protected + parameter Modelica.Units.SI.AngularVelocity omega=2*Modelica.Constants.pi*f; + annotation (Documentation(revisions=" + +")); + end lineInductance; + + replaceable partial function lineCapacitance + "Function that computes the capacitance of a cable" + extends Modelica.Icons.Function; + input Modelica.Units.SI.Length l "Length of the cable"; + input Modelica.Units.SI.Frequency f=50 + "Frequency considered in the definition of cables properties"; + output Modelica.Units.SI.Capacitance C "Capacitance of the cable"; + protected + parameter Modelica.Units.SI.AngularVelocity omega=2*Modelica.Constants.pi*f; + annotation (Documentation(revisions=" + +")); + end lineCapacitance; + + annotation (Documentation(revisions=" + +", info=" +

+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. +

+")); +end BaseCable; diff --git a/IBPSA/Electrical/Transmission/BaseClasses/PartialBaseLine.mo b/IBPSA/Electrical/Transmission/BaseClasses/PartialBaseLine.mo new file mode 100644 index 0000000000..0c0f87e1c5 --- /dev/null +++ b/IBPSA/Electrical/Transmission/BaseClasses/PartialBaseLine.mo @@ -0,0 +1,171 @@ +within IBPSA.Electrical.Transmission.BaseClasses; +partial model PartialBaseLine "Partial cable line dispersion model" + parameter Modelica.Units.SI.Length l(min=0) "Length of the line"; + parameter Modelica.Units.SI.Power P_nominal(min=0) + "Nominal power of the line"; + parameter Modelica.Units.SI.Voltage V_nominal(min=0, start=220) + "Nominal voltage of the line"; + final parameter Modelica.Units.SI.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" + annotation(Evaluate=true, Dialog(tab="Model", group="Assumptions")); + parameter IBPSA.Electrical.Types.Load modelMode=IBPSA.Electrical.Types.Load.FixedZ_steady_state + "Select between steady state and dynamic model" + annotation(Evaluate=true, Dialog(tab="Model", group="Assumptions", enable = use_C), choices(choice=IBPSA.Electrical.Types.Load.FixedZ_steady_state + "Steady state", choice=IBPSA.Electrical.Types.Load.FixedZ_dynamic "Dynamic")); + parameter Boolean use_T = false + "If true, enables the input for the temperature of the cable" annotation(Evaluate = true, Dialog(tab="Model", group="Thermal")); + parameter Modelica.Units.SI.Temperature TCable=T_ref + "Fixed temperature of the cable" annotation (Dialog( + tab="Model", + group="Thermal", + enable=not use_T)); + + parameter IBPSA.Electrical.Types.CableMode mode=IBPSA.Electrical.Types.CableMode.automatic + "Select if choosing the cable automatically or between a list of commercial options" + annotation(Evaluate=true, Dialog(tab="Tech. specification", group="Auto/Manual mode"), choicesAllMatching=true); + + replaceable parameter + IBPSA.Electrical.Transmission.LowVoltageCables.Generic + commercialCable constrainedby + IBPSA.Electrical.Transmission.BaseClasses.BaseCable + "Commercial cables options" + annotation(Evaluate=true, Dialog(tab="Tech. specification", group="Manual mode", + enable = mode == IBPSA.Electrical.Types.CableMode.commercial), + choicesAllMatching = true); + + final parameter Modelica.Units.SI.Temperature T_ref=commercialCable.T_ref + "Reference temperature of the line" annotation (Evaluate=True); + final parameter Modelica.Units.SI.Temperature M=commercialCable.M + "Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref))"; + final parameter Modelica.Units.SI.Resistance R=commercialCable.lineResistance( + l, + f_n, + commercialCable) "Resistance of the cable" annotation (Evaluate=True); + final parameter Modelica.Units.SI.Inductance L=commercialCable.lineInductance( + l, + f_n, + commercialCable) + "Inductance of the cable due to mutual and self inductance" + annotation (Evaluate=True); + final parameter Modelica.Units.SI.Capacitance C= + commercialCable.lineCapacitance( + l, + f_n, + commercialCable) "Capacitance of the cable" annotation (Evaluate=True); + Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature cableTemp + "Temperature of the cable" + annotation (Placement(transformation(extent={{-60,12},{-40,32}}))); + Modelica.Blocks.Interfaces.RealInput T if use_T "Temperature of the cable" + annotation ( + Placement(transformation(extent={{-42,28},{-2,68}}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,30}))); + Modelica.Blocks.Sources.RealExpression cableTemperature(y=T_in) + "Temperature of the cable" + annotation (Placement(transformation(extent={{-92,12},{-72,32}}))); +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) annotation (Line( + points={{-71,22},{-62,22}}, + color={0,0,127}, + smooth=Smooth.None)); + annotation ( Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Text( + extent={{-150,-19},{150,-59}}, + textColor={0,0,0}, + textString="%name")}), + Documentation(info=" +

+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 + +IBPSA.Electrical.Transmission.BaseClasses.BaseCable such as ( + +IBPSA.Electrical.Transmission.LowVoltageCables.Generic or + +IBPSA.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: +

+ +

+The details and type of cables can be found in + +IBPSA.Electrical.Transmission.LowVoltageCables and + +IBPSA.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 +IBPSA.Electrical.Transmission.Functions. +

+

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

+ +", revisions=" + +")); +end PartialBaseLine; diff --git a/IBPSA/Electrical/Transmission/BaseClasses/PartialLine.mo b/IBPSA/Electrical/Transmission/BaseClasses/PartialLine.mo new file mode 100644 index 0000000000..3d2ad4a813 --- /dev/null +++ b/IBPSA/Electrical/Transmission/BaseClasses/PartialLine.mo @@ -0,0 +1,42 @@ +within IBPSA.Electrical.Transmission.BaseClasses; +partial model PartialLine "Partial cable line dispersion model" + extends IBPSA.Electrical.Interfaces.PartialTwoPort; + extends IBPSA.Electrical.Transmission.BaseClasses.PartialBaseLine; + Real VoltageLosses(unit = "1") = abs(PhaseSystem_p.systemVoltage(terminal_p.v) - + PhaseSystem_n.systemVoltage(terminal_n.v))/ + IBPSA.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"; + + annotation ( Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Text( + extent={{-150,-19},{150,-59}}, + textColor={0,0,0}, + textString="%name")}), + Documentation(revisions=" + +", info=" +

+This partial model extends the model +IBPSA.Electrical.Transmission.BaseClasses.PartialBaseLine. +It adds two generalized electric connectors. +

+

Note:

+

+See +IBPSA.Electrical.Transmission.BaseClasses.PartialBaseLine for more information. +

+")); +end PartialLine; diff --git a/IBPSA/Electrical/Transmission/BaseClasses/PartialNetwork.mo b/IBPSA/Electrical/Transmission/BaseClasses/PartialNetwork.mo new file mode 100644 index 0000000000..c5e2758b95 --- /dev/null +++ b/IBPSA/Electrical/Transmission/BaseClasses/PartialNetwork.mo @@ -0,0 +1,131 @@ +within IBPSA.Electrical.Transmission.BaseClasses; +partial model PartialNetwork "Partial model that represent an electric network" + parameter Modelica.Units.SI.Voltage V_nominal(min=0, start=110) + "Nominal voltage of the lines in the network"; + replaceable parameter IBPSA.Electrical.Transmission.Grids.PartialGrid grid + "Record that describe the grid with the number of nodes, links, connections, etc." + annotation (choicesAllMatching=true, + Placement(transformation(extent={{40,60},{60,80}}))); + replaceable IBPSA.Electrical.Interfaces.BaseTerminal terminal[grid.nNodes] + "Electric terminals for each node of the network" + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + replaceable IBPSA.Electrical.Transmission.BaseClasses.PartialBaseLine lines[grid.nLinks]( + each mode=IBPSA.Electrical.Types.CableMode.commercial, + l={grid.l[i, 1] for i in 1:grid.nLinks}, + each P_nominal=1000, + each V_nominal=V_nominal) + "Array of line models, each line connecting two nodes of the grid"; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillPattern=FillPattern.Solid, + fillColor={255,255,255}), + Ellipse( + extent={{-6,86},{6,74}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-86,46},{-74,34}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-36,-24},{-24,-36}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{74,46},{86,34}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{74,-54},{86,-66}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-6,-74},{6,-86}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-66,6},{-54,-6}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{54,6},{66,-6}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Line( + points={{-80,40},{0,80}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-60,0},{0,80}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{0,-80},{60,0}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{-32,-28},{-60,0}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{80,40},{0,80}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{0,-80},{0,80}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{80,-62},{80,40}}, + color={0,0,0}, + smooth=Smooth.None), + Text( + extent={{-140,140},{140,100}}, + textColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + textString="%name")}), Documentation(revisions=" + +", info=" +

+This partial model represents a generalized electrical network. +

+

+The model has three main components. The parameter grid declares the type + +IBPSA.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 + +IBPSA.Electrical.Transmission.BaseClasses.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. +

+")); +end PartialNetwork; diff --git a/IBPSA/Electrical/Transmission/BaseClasses/PartialTwoPortInductance.mo b/IBPSA/Electrical/Transmission/BaseClasses/PartialTwoPortInductance.mo new file mode 100644 index 0000000000..87751372ef --- /dev/null +++ b/IBPSA/Electrical/Transmission/BaseClasses/PartialTwoPortInductance.mo @@ -0,0 +1,72 @@ +within IBPSA.Electrical.Transmission.BaseClasses; +partial model PartialTwoPortInductance + "Partial model of an inductive element that links two electrical connectors" + extends Interfaces.PartialTwoPort; + parameter Modelica.Units.SI.Inductance L "Inductance" + annotation (Evaluate=true); +equation + Connections.branch(terminal_p.theta, terminal_n.theta); + terminal_p.theta = terminal_n.theta; + + terminal_p.i = - terminal_n.i; + + annotation (Diagram(graphics={ + Rectangle(extent={{-70,30},{70,-30}}, lineColor={0,0,255}), + Line(points={{-90,0},{-70,0}}, color={0,0,255}), + Line(points={{70,0},{90,0}}, color={0,0,255})}), Icon( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), + graphics={ + Text( + extent={{-142,-30},{144,-62}}, + textColor={0,0,0}, + textString="L=%L"), + Line(points={{-90,0},{-70,0}}, color={0,0,0}), + Line(points={{70,0},{90,0}}, color={0,0,0}), + Rectangle( + extent={{-70,30},{70,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-42,14},{-14,-14}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-14,14},{14,-14}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{14,14},{42,-14}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-44,0},{44,-16}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Line( + points={{0,0},{12,1.46953e-15}}, + color={0,0,0}, + origin={-42,0}, + rotation=180), + Line( + points={{-6.85214e-44,-8.39117e-60},{10,1.22461e-15}}, + color={0,0,0}, + origin={52,0}, + rotation=180)}), + Documentation(revisions=" + +", info=" +

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

+")); +end PartialTwoPortInductance; diff --git a/IBPSA/Electrical/Transmission/BaseClasses/PartialTwoPortRLC.mo b/IBPSA/Electrical/Transmission/BaseClasses/PartialTwoPortRLC.mo new file mode 100644 index 0000000000..37e7751f88 --- /dev/null +++ b/IBPSA/Electrical/Transmission/BaseClasses/PartialTwoPortRLC.mo @@ -0,0 +1,131 @@ +within IBPSA.Electrical.Transmission.BaseClasses; +partial model PartialTwoPortRLC + "Partial model of an RLC element that links two electrical connectors" + extends IBPSA.Electrical.Interfaces.PartialTwoPort; + extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = T_ref); + parameter Modelica.Units.SI.Resistance R "Resistance at temperature T_ref" + annotation (Evaluate=true); + parameter Modelica.Units.SI.Temperature T_ref=298.15 "Reference temperature"; + parameter Modelica.Units.SI.Temperature M=507.65 + "Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref))"; + parameter Modelica.Units.SI.Capacitance C "Capacity"; + parameter Modelica.Units.SI.Inductance L "Inductance"; + parameter Modelica.Units.SI.Voltage V_nominal(min=0, start=110) + "Nominal voltage (V_nominal >= 0)" + annotation (Dialog(group="Nominal conditions")); + Modelica.Units.SI.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.Units.Conversions.to_degC(T_heatPort))/(M + + Modelica.Units.Conversions.to_degC(T_ref)); + + annotation (Diagram(graphics={ + Rectangle(extent={{-70,30},{70,-30}}, lineColor={0,0,255}), + Line(points={{-90,0},{-70,0}}, color={0,0,255}), + Line(points={{70,0},{90,0}}, color={0,0,255})}), Icon( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), + graphics={ + Text( + extent={{-148,-28},{138,-60}}, + textColor={0,0,0}, + textString="R=%R, L=%L"), + Line(points={{-90,0},{-70,0}}, color={0,0,0}), + Line(points={{70,0},{90,0}}, color={0,0,0}), + Rectangle( + extent={{-70,32},{70,-28}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-6.85214e-44,-8.39117e-60},{96,1.22003e-14}}, + color={0,0,0}, + origin={64,16}, + rotation=180), + Line( + visible = C > 0, + points={{-6.85214e-44,-8.39117e-60},{-4.17982e-15,16}}, + color={0,0,0}, + origin={22,16}, + rotation=180), + Line( + visible = C > 0, + points={{-6.85214e-44,-8.39117e-60},{16,1.95937e-15}}, + color={0,0,0}, + origin={30,0}, + rotation=180), + Line( + visible = C > 0, + points={{-6.85214e-44,-8.39117e-60},{16,1.95937e-15}}, + color={0,0,0}, + origin={30,-4}, + rotation=180), + Line( + visible = C > 0, + points={{-6.85214e-44,-8.39117e-60},{-2.40346e-15,16}}, + color={0,0,0}, + origin={22,-4}, + rotation=180), + Line( + points={{-66,16},{-60,16},{-58,20},{-54,12},{-50,20},{-46,12},{-42,20}, + {-38,12},{-36,16},{-32,16}}, + color={0,0,0}, + smooth=Smooth.None), + Ellipse( + extent={{-24,22},{-12,10}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-12,22},{0,10}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{0,22},{12,10}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-24,16},{12,4}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Text( + extent={{-142,-56},{144,-88}}, + textColor={0,0,0}, + textString="C=%C")}), + Documentation(revisions=" + +", info=" +

+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. +

+")); +end PartialTwoPortRLC; diff --git a/IBPSA/Electrical/Transmission/BaseClasses/PartialTwoPortResistance.mo b/IBPSA/Electrical/Transmission/BaseClasses/PartialTwoPortResistance.mo new file mode 100644 index 0000000000..d202cbccde --- /dev/null +++ b/IBPSA/Electrical/Transmission/BaseClasses/PartialTwoPortResistance.mo @@ -0,0 +1,66 @@ +within IBPSA.Electrical.Transmission.BaseClasses; +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.Units.SI.Resistance R "Resistance at temperature T_ref"; + parameter Modelica.Units.SI.Temperature T_ref=298.15 "Reference temperature"; + parameter Modelica.Units.SI.Temperature M=507.65 + "Temperature constant (R_actual = R*(M + T_heatPort)/(M + T_ref))"; + Modelica.Units.SI.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.Units.Conversions.to_degC(T_heatPort))/(M + + Modelica.Units.Conversions.to_degC(T_ref)); + + terminal_p.i = - terminal_n.i; + + annotation (Diagram(graphics={ + Rectangle(extent={{-70,30},{70,-30}}, lineColor={0,0,255}), + Line(points={{-90,0},{-70,0}}, color={0,0,255}), + Line(points={{70,0},{90,0}}, color={0,0,255})}), Icon( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), + graphics={ + Text( + extent={{-142,-30},{144,-62}}, + textColor={0,0,0}, + textString="R=%R"), + Line(points={{-90,0},{-70,0}}, color={0,0,0}), + Line(points={{70,0},{90,0}}, color={0,0,0}), + Rectangle( + extent={{-70,30},{70,-30}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), + Documentation(revisions=" + +", info=" +

+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. +

+")); +end PartialTwoPortResistance; diff --git a/IBPSA/Electrical/Transmission/BaseClasses/package.mo b/IBPSA/Electrical/Transmission/BaseClasses/package.mo new file mode 100644 index 0000000000..f3a056c4a5 --- /dev/null +++ b/IBPSA/Electrical/Transmission/BaseClasses/package.mo @@ -0,0 +1,19 @@ +within IBPSA.Electrical.Transmission; +package BaseClasses "Package that contains partial models for lines and cables" + extends Modelica.Icons.BasesPackage; + + +annotation (Documentation(revisions=" + +", info=" +

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

+")); +end BaseClasses; diff --git a/IBPSA/Electrical/Transmission/BaseClasses/package.order b/IBPSA/Electrical/Transmission/BaseClasses/package.order new file mode 100644 index 0000000000..70fcbed17b --- /dev/null +++ b/IBPSA/Electrical/Transmission/BaseClasses/package.order @@ -0,0 +1,7 @@ +PartialBaseLine +PartialLine +PartialNetwork +PartialTwoPortInductance +PartialTwoPortRLC +PartialTwoPortResistance +BaseCable diff --git a/IBPSA/Electrical/Transmission/Functions/R_AC_correction.mo b/IBPSA/Electrical/Transmission/Functions/R_AC_correction.mo new file mode 100644 index 0000000000..a92c50f41a --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/R_AC_correction.mo @@ -0,0 +1,293 @@ +within IBPSA.Electrical.Transmission.Functions; +function R_AC_correction + "This function computes the correction factor of the DC resistance for AC systems at 60 Hz" + input String size "Size of the commercial cable (AWG or kcmil)"; + input IBPSA.Electrical.Transmission.Types.Material material + "Material of the cable"; + output Real correction "Correction factor"; +algorithm + if material == IBPSA.Electrical.Transmission.Types.Material.Al then + if size == "1/0" then + correction := 1.0; + elseif size == "2/0" then + correction := 1.001; + elseif size == "3/0" then + correction := 1.001; + elseif size == "4/0" then + correction := 1.001; + elseif size == "250" then + correction := 1.002; + elseif size == "300" then + correction := 1.003; + elseif size == "350" then + correction := 1.004; + elseif size == "400" then + correction := 1.005; + elseif size == "500" then + correction := 1.007; + elseif size == "600" then + correction := 1.01; + elseif size == "700" then + correction := 1.013; + elseif size == "750" then + correction := 1.015; + elseif size == "800" then + correction := 1.017; + elseif size == "1000" then + correction := 1.026; + elseif size == "1250" then + correction := 1.04; + elseif size == "1500" then + correction := 1.058; + elseif size == "1750" then + correction := 1.079; + elseif size == "2000" then + correction := 1.1; + elseif size == "2500" then + correction := 1.142; + else + correction := 1.0; + end if; + + elseif material == IBPSA.Electrical.Transmission.Types.Material.Cu then + if size == "1/0" then + correction := 1.0; + elseif size == "2/0" then + correction := 1.001; + elseif size == "3/0" then + correction := 1.002; + elseif size == "4/0" then + correction := 1.004; + elseif size == "250" then + correction := 1.005; + elseif size == "300" then + correction := 1.006; + elseif size == "350" then + correction := 1.009; + elseif size == "400" then + correction := 1.011; + elseif size == "500" then + correction := 1.018; + elseif size == "600" then + correction := 1.025; + elseif size == "700" then + correction := 1.034; + elseif size == "750" then + correction := 1.039; + elseif size == "800" then + correction := 1.044; + elseif size == "1000" then + correction := 1.067; + elseif size == "1250" then + correction := 1.102; + elseif size == "1500" then + correction := 1.142; + elseif size == "1750" then + correction := 1.185; + elseif size == "2000" then + correction := 1.233; + elseif size == "2500" then + correction := 1.326; + else + correction := 1.0; + end if; + else + assert(material <> IBPSA.Electrical.Transmission.Types.Material.Al and + material <> IBPSA.Electrical.Transmission.Types.Material.Cu, + "In function IBPSA.Electrical.Transmission.Functions.R_AC_Correction, + does not support material " + String(material) + ". + The selected cable has the R_AC_Correction of the Copper.", + level = AssertionLevel.warning); + + correction := 1.0; + end if; +annotation(Inline = true, Documentation(revisions=" + +", info=" +

+This function computes a correction factor for adapting the DC resistance +when working with AC voltages. The correction factor assumes f = 60 Hz. +

+

+The correction is based on the type of cabel (AWG or kcmil) and the material. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Type (AWG or kcmil)MaterialCorrection factor
1/0Aluminium1.0
2/0Aluminium1.001
3/0Aluminium1.001
4/0Aluminium1.001
250Aluminium1.002
300Aluminium1.003
350Aluminium1.004
400Aluminium1.005
500Aluminium1.007
600Aluminium1.010
700Aluminium1.013
750Aluminium1.015
800Aluminium1.017
1000Aluminium1.026
1250Aluminium1.040
1500Aluminium1.058
1750Aluminium1.079
2000Aluminium1.100
2500Aluminium1.142
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Type (AWG or kcmil)MaterialCorrection factor
1/0Copper1.0
2/0Copper1.001
3/0Copper1.002
4/0Copper1.004
250Copper1.005
300Copper1.006
350Copper1.009
400Copper1.011
500Copper1.018
600Copper1.025
700Copper1.034
750Copper1.039
800Copper1.044
1000Copper1.067
1250Copper1.102
1500Copper1.142
1750Copper1.185
2000Copper1.233
2500Copper1.326
+ +")); +end R_AC_correction; diff --git a/IBPSA/Electrical/Transmission/Functions/Validation/SelectCable_low.mo b/IBPSA/Electrical/Transmission/Functions/Validation/SelectCable_low.mo new file mode 100644 index 0000000000..52c635b32d --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/Validation/SelectCable_low.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.Transmission.Functions.Validation; +model SelectCable_low + "Validation model for the function that selects the cable" + extends Modelica.Icons.Example; + + parameter Modelica.Units.SI.Voltage V_nominal=480 "Rated voltage"; + + parameter Modelica.Units.SI.Power[:] P_nominal=I_nominal*V_nominal/ + safety_factor "Rated power"; + parameter Modelica.Units.SI.Current[:] I_nominal={65,95,110,130,170,220,230} + .- 10 "Nominal current"; + + parameter Real safety_factor = 1.2 "Safety factor"; + + parameter IBPSA.Electrical.Transmission.LowVoltageCables.Generic[:] cab = IBPSA.Electrical.Transmission.Functions.selectCable_low( + P_nominal = P_nominal, + V_nominal = V_nominal) + "Selected cable"; + +annotation ( +experiment(Tolerance=1e-6, StopTime=1.0), + __Dymola_Commands( +file="modelica://IBPSA/Resources/Scripts/Dymola/Electrical/Transmission/Functions/Validation/SelectCable_low.mos" +"Simulate and plot"), +Documentation(info=" +

+This model validates + +IBPSA.Electrical.Transmission.Functions.selectCable_low +for a different range of currents. +

+", revisions=" + +")); +end SelectCable_low; diff --git a/IBPSA/Electrical/Transmission/Functions/Validation/SelectCable_med.mo b/IBPSA/Electrical/Transmission/Functions/Validation/SelectCable_med.mo new file mode 100644 index 0000000000..65d533dd0b --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/Validation/SelectCable_med.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.Transmission.Functions.Validation; +model SelectCable_med + "Validation model for the function that selects the cable" + extends Modelica.Icons.Example; + + parameter Modelica.Units.SI.Voltage V_nominal=25e3 "Rated voltage"; + + parameter Modelica.Units.SI.Power[:] P_nominal=I_nominal*V_nominal/ + safety_factor "Rated power"; + parameter Modelica.Units.SI.Current[:] I_nominal={195,250,285,375,450,640,800} + .- 10 "Nominal current"; + + parameter Real safety_factor = 1.2 "Safety factor"; + + parameter IBPSA.Electrical.Transmission.MediumVoltageCables.Generic[:] cab = IBPSA.Electrical.Transmission.Functions.selectCable_med( + P_nominal = P_nominal, + V_nominal = V_nominal) + "Selected cable"; + +annotation ( +experiment(Tolerance=1e-6, StopTime=1.0), + __Dymola_Commands( +file="modelica://IBPSA/Resources/Scripts/Dymola/Electrical/Transmission/Functions/Validation/SelectCable_med.mos" +"Simulate and plot"), +Documentation(info=" +

+This model validates + +IBPSA.Electrical.Transmission.Functions.selectCable_med +for a different range of currents. +

+", revisions=" + +")); +end SelectCable_med; diff --git a/IBPSA/Electrical/Transmission/Functions/Validation/package.mo b/IBPSA/Electrical/Transmission/Functions/Validation/package.mo new file mode 100644 index 0000000000..183eb077e2 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/Validation/package.mo @@ -0,0 +1,18 @@ +within IBPSA.Electrical.Transmission.Functions; +package Validation + extends Modelica.Icons.ExamplesPackage; + +annotation (Documentation(info=" +

+This package contains validation models for the classes in + +IBPSA.Electrical.Transmission.Functions. +

+

+Note that most validation models contain simple input data which may not be realistic, +but for which the correct output can be obtained through an analytic solution. +The examples plot various outputs, which have been verified against these solutions. +These model outputs are stored as reference data and used for continuous validation +whenever models in the library change. +")); +end Validation; diff --git a/IBPSA/Electrical/Transmission/Functions/Validation/package.order b/IBPSA/Electrical/Transmission/Functions/Validation/package.order new file mode 100644 index 0000000000..17fc38e447 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/Validation/package.order @@ -0,0 +1,2 @@ +SelectCable_low +SelectCable_med diff --git a/IBPSA/Electrical/Transmission/Functions/computeGMD.mo b/IBPSA/Electrical/Transmission/Functions/computeGMD.mo new file mode 100644 index 0000000000..83f1f430ac --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/computeGMD.mo @@ -0,0 +1,32 @@ +within IBPSA.Electrical.Transmission.Functions; +function computeGMD + "This function computes the geometric mean distance of a three-phase transmission line" + input Modelica.Units.SI.Length d1 "Distance between conductors"; + input Modelica.Units.SI.Length d2=d1 "Distance between conductors"; + input Modelica.Units.SI.Length d3=2*d1 "Distance between conductors"; + output Modelica.Units.SI.Length GMD "Geometric Mean Distance"; +algorithm + GMD := (d1*d2*d3)^(1.0/3.0); +annotation(Inline = true, Documentation(revisions=" +

+", info=" +

+This function computes the Geometric Mean Distance of a cable. +

+

+The GMD is computed as +

+

+GMD = (d1 d2 d3)1/3, +

+

+where d1, d2, and d3 are + the distances between the conductors. +

+")); +end computeGMD; diff --git a/IBPSA/Electrical/Transmission/Functions/computeGMR.mo b/IBPSA/Electrical/Transmission/Functions/computeGMR.mo new file mode 100644 index 0000000000..0681782133 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/computeGMR.mo @@ -0,0 +1,60 @@ +within IBPSA.Electrical.Transmission.Functions; +function computeGMR + "This function computes the geometric mean radius of a cable with 1 to 4 conductors" + input Modelica.Units.SI.Length d "Diameter of the conductor"; + input Integer N = 1 "Number of conductors"; + output Modelica.Units.SI.Length GMR "Geometric Mean Radius"; +algorithm + assert(N > 0 and N < 5, + "The number of conductors N must be between 1 and 4, received N=" + String(N) + "."); + if N==1 then + GMR := 0.5*d*0.7788; + elseif N==2 then + GMR := sqrt(d); + elseif N==3 then + GMR := (d^2)^(1/3); + else // N == 4 + GMR := 1.09*(d^3)^(1/4); + end if; +annotation(Inline = true, Documentation(revisions=" + +", info=" +

+This function computes the Geometric Mean Radius (GMR) of a cable. +

+

+The GMR is computed as follow, depending on the number of conductors N +that are part of the cable, and the diamater of the conductor d. +

+ + + + + + + + + + + + + + + + + + + + + + + +
EquationCondition
0.7788 (d/2) N = 1
d1/2N = 2
d2/3N = 3
d2/3N = 4
+ +")); +end computeGMR; diff --git a/IBPSA/Electrical/Transmission/Functions/package.mo b/IBPSA/Electrical/Transmission/Functions/package.mo new file mode 100644 index 0000000000..4a727aeeaf --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/package.mo @@ -0,0 +1,20 @@ +within IBPSA.Electrical.Transmission; +package Functions "Package that contains functions to compute cable properties" + extends Modelica.Icons.Package; + + +annotation (Documentation(revisions=" + +", info=" +

+This package contains various functions that are used to compute +cable properties and select the default cable during +automatic parametrization. +

+")); +end Functions; diff --git a/IBPSA/Electrical/Transmission/Functions/package.order b/IBPSA/Electrical/Transmission/Functions/package.order new file mode 100644 index 0000000000..d62457d0b8 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/package.order @@ -0,0 +1,7 @@ +R_AC_correction +computeGMD +computeGMR +selectCable_low +selectCable_med +selectVoltageLevel +Validation diff --git a/IBPSA/Electrical/Transmission/Functions/selectCable_low.mo b/IBPSA/Electrical/Transmission/Functions/selectCable_low.mo new file mode 100644 index 0000000000..42405e0fba --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/selectCable_low.mo @@ -0,0 +1,90 @@ +within IBPSA.Electrical.Transmission.Functions; +function selectCable_low "This function is used to automatically select the + type of cable for low voltages" + input Modelica.Units.SI.Power P_nominal=0 "Rated power"; + input Modelica.Units.SI.Voltage V_nominal=0 "Rated voltage"; + output IBPSA.Electrical.Transmission.LowVoltageCables.Generic cable "Cable"; +protected + parameter Real safety_factor = 1.2; + Modelica.Units.SI.Current I_nominal + "Nominal current flowing through the line"; + IBPSA.Electrical.Transmission.LowVoltageCables.Cu10 cu10; + IBPSA.Electrical.Transmission.LowVoltageCables.Cu20 cu20; + IBPSA.Electrical.Transmission.LowVoltageCables.Cu25 cu25; + IBPSA.Electrical.Transmission.LowVoltageCables.Cu35 cu35; + IBPSA.Electrical.Transmission.LowVoltageCables.Cu50 cu50; + IBPSA.Electrical.Transmission.LowVoltageCables.Cu95 cu95; + IBPSA.Electrical.Transmission.LowVoltageCables.Cu100 cu100; +algorithm + + assert(Transmission.Functions.selectVoltageLevel(V_nominal) == IBPSA.Electrical.Types.VoltageLevel.Low, + "In function IBPSA.Electrical.Transmission.Functions.selectCable_low, + cable autosizing has a nominal Voltage " + String(V_nominal) + " [V]. + The low voltage cables do not support such a voltage level.", + level=AssertionLevel.error); + + // Check if it's possible to compute the current + if V_nominal > 0 then + I_nominal :=safety_factor*P_nominal/V_nominal; + else + I_nominal :=0; + end if; + + // Assumed the material is Copper + if I_nominal < cu10.Amp then + cable := cu10; + elseif I_nominal >= cu10.Amp and I_nominal < cu20.Amp then + cable := cu20; + elseif I_nominal >= cu20.Amp and I_nominal < cu25.Amp then + cable := cu25; + elseif I_nominal >= cu25.Amp and I_nominal < cu35.Amp then + cable := cu35; + elseif I_nominal >= cu35.Amp and I_nominal < cu50.Amp then + cable := cu50; + elseif I_nominal >= cu50.Amp and I_nominal < cu95.Amp then + cable := cu95; + elseif I_nominal >= cu95.Amp and I_nominal < cu100.Amp then + cable := cu100; + else + assert(I_nominal < cu100.Amp, +"In function IBPSA.Electrical.Transmission.Functions.selectCable_low, + cable autosizing does not support a current of " + String(I_nominal) + " [A]. + The selected cable will be undersized.", + level=AssertionLevel.warning); + cable := cu100; + end if; +annotation(Inline = true, Documentation(revisions=" + +", info=" +

+This function selects the default cable for a low voltage +transmission line. +

+

+The function takes as inputs the nominal voltage Vnominal and the +nominal power Pnominal. It computes the maximum current current that +can flow through the cable as +

+

+IMAX = SF Pnominal / Vnominal, +

+

+where SF is the safety factor. By default the safety factor is equal to 1.2. +

+

+Using IMAX, the function selects the smallest cable that has an ampacity +higher than IMAX. The cables are selected from + +IBPSA.Electrical.Transmission.LowVoltageCables. +

+")); +end selectCable_low; diff --git a/IBPSA/Electrical/Transmission/Functions/selectCable_med.mo b/IBPSA/Electrical/Transmission/Functions/selectCable_med.mo new file mode 100644 index 0000000000..b91d52a5d4 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/selectCable_med.mo @@ -0,0 +1,91 @@ +within IBPSA.Electrical.Transmission.Functions; +function selectCable_med "This function is used to automatically select the + type of cable for medium voltages" + input Modelica.Units.SI.Power P_nominal=0 "Rated power"; + input Modelica.Units.SI.Voltage V_nominal=0 "Rated voltage"; + output IBPSA.Electrical.Transmission.MediumVoltageCables.Generic cable "Cable"; +protected + parameter Real safety_factor = 1.2; + Modelica.Units.SI.Current I_nominal + "Nominal current flowing through the line"; + IBPSA.Electrical.Transmission.MediumVoltageCables.Annealed_Al_10 Al10; + IBPSA.Electrical.Transmission.MediumVoltageCables.Annealed_Al_30 Al30; + IBPSA.Electrical.Transmission.MediumVoltageCables.Annealed_Al_40 Al40; + IBPSA.Electrical.Transmission.MediumVoltageCables.Annealed_Al_350 Al350; + IBPSA.Electrical.Transmission.MediumVoltageCables.Annealed_Al_500 Al500; + IBPSA.Electrical.Transmission.MediumVoltageCables.Annealed_Al_1000 Al1000; + IBPSA.Electrical.Transmission.MediumVoltageCables.Annealed_Al_1500 Al1500; +algorithm + + assert(Transmission.Functions.selectVoltageLevel(V_nominal) == IBPSA.Electrical.Types.VoltageLevel.Medium, + "In function IBPSA.Electrical.Transmission.Functions.selectCable_med, + cable autosizing has a nominal Voltage " + String(V_nominal) + " [V]. + The medium voltage cables do not support such a voltage level.", + level=AssertionLevel.error); + + // Check if it's possible to compute the current + if V_nominal > 0 then + I_nominal :=safety_factor*P_nominal/V_nominal; + else + I_nominal :=0; + end if; + + // Assumed the material is Copper + if I_nominal < Al10.Amp then + cable := Al10; + elseif I_nominal >= Al10.Amp and I_nominal < Al30.Amp then + cable := Al30; + elseif I_nominal >= Al30.Amp and I_nominal < Al40.Amp then + cable := Al40; + elseif I_nominal >= Al40.Amp and I_nominal < Al350.Amp then + cable := Al350; + elseif I_nominal >= Al350.Amp and I_nominal < Al500.Amp then + cable := Al500; + elseif I_nominal >= Al500.Amp and I_nominal < Al1000.Amp then + cable := Al1000; + elseif I_nominal >= Al1000.Amp and I_nominal < Al1500.Amp then + cable := Al1500; + else + assert(I_nominal < Al1500.Amp, +"Warning: In function IBPSA.Electrical.Transmission.Functions.selectCable_med, + cable autosizing does not support a current of " + String(I_nominal) + " [A]. + The selected cable will be undersized.", + level=AssertionLevel.warning); + + cable := Al10; + end if; +annotation(Inline = true, Documentation(revisions=" + +", info=" +

+This function selects the default cable for a medium voltage +transmission line. +

+

+The function takes as inputs the nominal voltage Vnominal and the +nominal power Pnominal. It computes the maximum current current that +can flow through the cable as +

+

+IMAX = SF Pnominal / Vnominal, +

+

+where SF is the safety factor. By default the safety factor is equal to 1.2. +

+

+Using IMAX, the function selects the smallest cable that has an ampacity +higher than IMAX. The cables are selected from + +IBPSA.Electrical.Transmission.MediumVoltageCables. +

+")); +end selectCable_med; diff --git a/IBPSA/Electrical/Transmission/Functions/selectVoltageLevel.mo b/IBPSA/Electrical/Transmission/Functions/selectVoltageLevel.mo new file mode 100644 index 0000000000..8c2b463f75 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Functions/selectVoltageLevel.mo @@ -0,0 +1,61 @@ +within IBPSA.Electrical.Transmission.Functions; +function selectVoltageLevel + "This function computes the voltage level (low, medium or high) given the nominal voltage" + input Modelica.Units.SI.Voltage V "Nominal voltage"; + output IBPSA.Electrical.Types.VoltageLevel level "Type of voltage level"; +algorithm + if V <= 0 then + assert(V > 0, + "In function IBPSA.Electrical.Transmission.Functions.selectVoltageLevel, + does not support a voltage of " + String(V) + " [V]. + The selected voltage level will be assumed to be low.", + level = AssertionLevel.warning); + level := IBPSA.Electrical.Types.VoltageLevel.Low; + elseif V <= 1000 then + level := IBPSA.Electrical.Types.VoltageLevel.Low; + elseif V > 1000 and V <= 50000 then + level := IBPSA.Electrical.Types.VoltageLevel.Medium; + else + level := IBPSA.Electrical.Types.VoltageLevel.High; + end if; +annotation(Inline = true, Documentation(revisions=" + +", info=" +

+This function computes the voltage level for a given voltage. +The computation is as follows: +

+ + + + + + + + + + + + + + + + + + + + + +
ConditionVoltage Level
0 ≤ V < 1 kVLow voltage
1 kV ≤ V < 50 kVMedium voltage
V ≥ 50 kVHIgh voltage
+ +")); +end selectVoltageLevel; diff --git a/IBPSA/Electrical/Transmission/Grids/IEEE_34_AL120.mo b/IBPSA/Electrical/Transmission/Grids/IEEE_34_AL120.mo new file mode 100644 index 0000000000..087679cfd3 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Grids/IEEE_34_AL120.mo @@ -0,0 +1,72 @@ +within IBPSA.Electrical.Transmission.Grids; +record IEEE_34_AL120 "Grid model inspired to the IEEE 34 Node test feeder" + extends IBPSA.Electrical.Transmission.Grids.PartialGrid( + nNodes=34, + nLinks=33, + l=[48;16;16;40;32;16;16;16;16;16;16;32;32;16;32;32;32;48;48;32;32;16;16;16; + 16;16;32;32;16;32;16;16;16], + fromTo=[[1,2]; [2,3]; [3,4]; [4,5]; [4,6]; [6,7]; [7,8]; [9,26]; [10,26]; [ + 11,9]; [12,11]; [13,10]; [14,10]; [15,14]; [16,15]; [17,27]; [18,27]; [ + 19,31]; [20,31]; [21,32]; [22,32]; [23,20]; [24,23]; [25,24]; [26,8]; [ + 27,29]; [28,16]; [29,16]; [30,17]; [31,17]; [32,19]; [33,22]; [34,18]], + redeclare IBPSA.Electrical.Transmission.LowVoltageCables.Generic cables= + {LowVoltageCables.PvcAl120(),LowVoltageCables.PvcAl120(), + LowVoltageCables.PvcAl120(),LowVoltageCables.PvcAl120(), + LowVoltageCables.PvcAl120(),LowVoltageCables.PvcAl120(), + LowVoltageCables.PvcAl120(),LowVoltageCables.PvcAl120(), + LowVoltageCables.PvcAl120(),LowVoltageCables.PvcAl120(), + LowVoltageCables.PvcAl120(),LowVoltageCables.PvcAl120(), + LowVoltageCables.PvcAl120(),LowVoltageCables.PvcAl120(), + LowVoltageCables.PvcAl120(),LowVoltageCables.PvcAl70(), + LowVoltageCables.PvcAl70(),LowVoltageCables.PvcAl35(), + LowVoltageCables.PvcAl35(),LowVoltageCables.PvcAl35(), + LowVoltageCables.PvcAl35(),LowVoltageCables.PvcAl35(), + LowVoltageCables.PvcAl35(),LowVoltageCables.PvcAl35(), + LowVoltageCables.PvcAl120(),LowVoltageCables.PvcAl70(), + LowVoltageCables.PvcAl70(),LowVoltageCables.PvcAl70(), + LowVoltageCables.PvcAl70(),LowVoltageCables.PvcAl70(), + LowVoltageCables.PvcAl35(),LowVoltageCables.PvcAl35(), + LowVoltageCables.PvcAl70()}); + + /* + LEFT HERE TO CHECK CONSISTENCY + + LenVec={ + 0,48,16,16,40, + 32,16,16,16,16, + 16,16,32,32,16, + 32,32,32,48,48, + 32,32,16,16,16, + 16,16,32,32,16, + 32,16,16,16}, + + CabTyp={ + ,.PvcAl120(),.PvcAl120(),.PvcAl120(),.PvcAl120(), + .PvcAl120(),.PvcAl120(),.PvcAl120(),.PvcAl120(),.PvcAl120(), + .PvcAl120(),.PvcAl120(),.PvcAl120(),.PvcAl120(),.PvcAl120(), + .PvcAl120(),.PvcAl70(),.PvcAl70(),.PvcAl35(),.PvcAl35(), + .PvcAl35(),.PvcAl35(),.PvcAl35(),.PvcAl35(),.PvcAl35(), + .PvcAl120(),.PvcAl70(),.PvcAl70(),.PvcAl70(),.PvcAl70(), + .PvcAl70(),.PvcAl35(),.PvcAl35(),.PvcAl70()}); + + */ + annotation (Documentation(info=" +

This model represents a grid inspired by the IEEE 34 node test feeder. +In this example, the cable types and lengths have been modified in order to +represent a typical distribution feeder.

+

The following three type of cables are in the grid: AL120, AL70, and Al35. +

+

\"alt-image\"

+", revisions=" + +")); +end IEEE_34_AL120; diff --git a/IBPSA/Electrical/Transmission/Grids/PartialGrid.mo b/IBPSA/Electrical/Transmission/Grids/PartialGrid.mo new file mode 100644 index 0000000000..23dcfa3647 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Grids/PartialGrid.mo @@ -0,0 +1,47 @@ +within IBPSA.Electrical.Transmission.Grids; +record PartialGrid "Partial model that represents a generalized grid" + extends Modelica.Icons.MaterialProperty; + parameter Integer nNodes "Number of nodes of the grid"; + parameter Integer nLinks "Number of links connecting the nodes"; + parameter Integer fromTo[nLinks,2] + "Indexes [i,1]->[i,2] of the nodes connected by link i"; + parameter Modelica.Units.SI.Length l[nLinks,1](each min=0) + "Length of the cable"; + replaceable IBPSA.Electrical.Transmission.BaseClasses.BaseCable cables[nLinks] + "Array that contains the characteristics of each cable"; + annotation (Documentation(info=" +

+This abstract grid model specifies the topology of the network by +

+ +

+The picture below describes the meaning of the +values contained in the matrices. +

+ +

+\"image\" +

+", revisions=" + +"), Icon(graphics={ + Text( + textColor={0,0,255}, + extent={{-154,104},{146,144}}, + textString="%name")})); +end PartialGrid; diff --git a/IBPSA/Electrical/Transmission/Grids/TestGrid2Nodes.mo b/IBPSA/Electrical/Transmission/Grids/TestGrid2Nodes.mo new file mode 100644 index 0000000000..3d49a79cdb --- /dev/null +++ b/IBPSA/Electrical/Transmission/Grids/TestGrid2Nodes.mo @@ -0,0 +1,32 @@ +within IBPSA.Electrical.Transmission.Grids; +record TestGrid2Nodes "Simple model of a grid with 2 nodes and 1 link" + extends IBPSA.Electrical.Transmission.Grids.PartialGrid( + nNodes=2, + nLinks=1, + fromTo=[[1,2]], + l=[200], + redeclare IBPSA.Electrical.Transmission.LowVoltageCables.Generic + cables = {LowVoltageCables.Cu35()}); + annotation (Documentation(info=" +

+This model represents a simple grid with two nodes and a single link between them. +

+

+The picture below describes the grid topology. +

+

+\"image\" +

+", revisions=" + +")); +end TestGrid2Nodes; diff --git a/IBPSA/Electrical/Transmission/Grids/TestGrid2NodesMedium.mo b/IBPSA/Electrical/Transmission/Grids/TestGrid2NodesMedium.mo new file mode 100644 index 0000000000..e116f2c782 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Grids/TestGrid2NodesMedium.mo @@ -0,0 +1,37 @@ +within IBPSA.Electrical.Transmission.Grids; +record TestGrid2NodesMedium + "Simple model of a grid with 2 nodes and 1 link for medium voltage" + extends IBPSA.Electrical.Transmission.Grids.PartialGrid( + nNodes=2, + nLinks=1, + fromTo=[[1,2]], + l=[200], + redeclare IBPSA.Electrical.Transmission.MediumVoltageCables.Generic + cables = {MediumVoltageCables.Annealed_Al_30()}); + annotation (Documentation(info=" +

+This model represents a simple grid with two nodes and a single link between them. +This model differs from + +IBPSA.Electrical.Transmission.Grids.TestGrid2Nodes because it defines a medium voltage +cable instead of a low voltage cable. +

+

+The picture below describes the grid topology. +

+

+\"image\" +

+", revisions=" + +")); +end TestGrid2NodesMedium; diff --git a/IBPSA/Electrical/Transmission/Grids/package.mo b/IBPSA/Electrical/Transmission/Grids/package.mo new file mode 100644 index 0000000000..72246053bc --- /dev/null +++ b/IBPSA/Electrical/Transmission/Grids/package.mo @@ -0,0 +1,25 @@ +within IBPSA.Electrical.Transmission; +package Grids "Package that contains different types of grids" + extends Modelica.Icons.MaterialPropertiesPackage; + + +annotation (Documentation(revisions=" + +", info=" +

+This package contains different types of grids that can be used to represent +electrical networks. The topology of the network is specified by +

+ +")); +end Grids; diff --git a/IBPSA/Electrical/Transmission/Grids/package.order b/IBPSA/Electrical/Transmission/Grids/package.order new file mode 100644 index 0000000000..ea44995adc --- /dev/null +++ b/IBPSA/Electrical/Transmission/Grids/package.order @@ -0,0 +1,4 @@ +IEEE_34_AL120 +PartialGrid +TestGrid2Nodes +TestGrid2NodesMedium diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/Cu10.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu10.mo new file mode 100644 index 0000000000..d9c832128e --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu10.mo @@ -0,0 +1,31 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record Cu10 "Cu cable 10 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Cu, + M = 234.5 + 273.15, + Amp=65, + RCha=1.81e-003, + XCha=0.076e-003); + annotation (Documentation(info=" +

+Copper cable with a cross-sectional area of 10mm^2. +This type of cable has the following properties +

+
+RCha = 1.810-003 // Characteristic resistance [Ohm/m]
+XCha = 0.076e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end Cu10; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/Cu100.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu100.mo new file mode 100644 index 0000000000..486ddc3913 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu100.mo @@ -0,0 +1,31 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record Cu100 "Cu cable 100 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Cu, + M = 234.5 + 273.15, + Amp = 230, + RCha=0.181e-003, + XCha=0.072e-003); + annotation (Documentation(info=" +

+Copper cable with a cross-sectional area of 100mm^2. +This type of cable has the following properties +

+
+RCha = 0.181e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.072e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end Cu100; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/Cu20.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu20.mo new file mode 100644 index 0000000000..a786b18de4 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu20.mo @@ -0,0 +1,31 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record Cu20 "Cu cable 20 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Cu, + M = 234.5 + 273.15, + Amp=95, + RCha=0.905e-003, + XCha=0.075e-003); + annotation (Documentation(info=" +

+Copper cable with a cross-sectional area of 20mm^2. +This type of cable has the following properties +

+
+RCha = 0.905e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.075e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end Cu20; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/Cu25.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu25.mo new file mode 100644 index 0000000000..d18426d0b8 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu25.mo @@ -0,0 +1,31 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record Cu25 "Cu cable 25 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Cu, + M = 234.5 + 273.15, + Amp=110, + RCha=0.727e-003, + XCha=0.075e-003); + annotation (Documentation(info=" +

+Copper cable with a cross-sectional area of 25mm^2. +This type of cable has the following properties +

+
+RCha = 0.727e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.075e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end Cu25; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/Cu35.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu35.mo new file mode 100644 index 0000000000..ef9d42e99b --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu35.mo @@ -0,0 +1,31 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record Cu35 "Cu cable 35 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Cu, + M = 234.5 + 273.15, + Amp=130, + RCha=0.517e-003, + XCha=0.074e-003); + annotation (Documentation(info=" +

+Copper cable with a cross-sectional area of 35mm^2. +This type of cable has the following properties +

+
+RCha = 0.517e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.074e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end Cu35; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/Cu50.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu50.mo new file mode 100644 index 0000000000..39e288bae9 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu50.mo @@ -0,0 +1,31 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record Cu50 "Cu cable 50 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Cu, + M = 234.5 + 273.15, + Amp=170, + RCha=0.362e-003, + XCha=0.073e-003); + annotation (Documentation(info=" +

+Copper cable with a cross-sectional area of 50mm^2. +This type of cable has the following properties +

+
+RCha = 0.362e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.073e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end Cu50; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/Cu95.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu95.mo new file mode 100644 index 0000000000..396881fdd8 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/Cu95.mo @@ -0,0 +1,31 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record Cu95 "Cu cable 95 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Cu, + M = 234.5 + 273.15, + Amp=220, + RCha=0.191e-003, + XCha=0.072e-003); + annotation (Documentation(info=" +

+Copper cable with a cross-sectional area of 95mm^2. +This type of cable has the following properties +

+
+RCha = 0.191e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.072e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end Cu95; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/Generic.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/Generic.mo new file mode 100644 index 0000000000..b8c8727b05 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/Generic.mo @@ -0,0 +1,124 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record Generic "Data record for a generic low voltage cable" + extends Modelica.Icons.MaterialProperty; + extends IBPSA.Electrical.Transmission.BaseClasses.BaseCable; + parameter IBPSA.Electrical.Types.CharacteristicResistance RCha(start=0) + "Characteristic resistance of the cable"; + parameter IBPSA.Electrical.Types.CharacteristicReactance XCha(start=0) + "Characteristic reactance of the cable"; + + redeclare function extends lineResistance + "Function that computes the resistance of a cable" + input IBPSA.Electrical.Transmission.LowVoltageCables.Generic cable + "Record that contains cable properties"; + algorithm + R :=cable.RCha*l; + annotation(Inline=true, Documentation(revisions=" + +", info=" +

+This function computes the overall resistance of a cable. +

+ +

+The low voltage cable is described by a characteristic resistance per unit +length, given this value the overall resistance is computed as +

+

+R = RCHA lCABLE, +

+

+where RCHA is the characteristic resistance per unit length, and +lCABLE is the length of the cable. +

+")); + end lineResistance; + + redeclare function extends lineInductance + "Function that computes the resistance of a cable" + input IBPSA.Electrical.Transmission.LowVoltageCables.Generic cable + "Record that contains cable properties"; + algorithm + L := l*(cable.XCha/omega); + annotation(Inline=true, Documentation(revisions=" + +", info=" +

+This function computes the overall inductance of a cable. +

+

+When the voltage level is low, the cables have a characteristic reactance per unit +length, which is specified at f = 50 Hz. +The overall inductance is computed as +

+

+L = (XCHA/ω) lCABLE, +

+

+where XCHA is the characteristic reactance per unit length, +ω = 2 π f is the angular velocity, and lCABLE is +the length of the cable. +

+")); + end lineInductance; + + redeclare function extends lineCapacitance + "Function that computes the capacitance of a cable" + input IBPSA.Electrical.Transmission.LowVoltageCables.Generic cable + "Record that contains cable properties"; + algorithm + C := 0.0; + annotation(Inline=true, Documentation(revisions=" + +", info=" +

+This function computes the overall capacity of a cable. +

+

+When the voltage level is low, the cables do not consider the capacitive effect. Hence, +

+

+C = 0. +

+")); + end lineCapacitance; + + annotation (Documentation(info=" +

+This is a base record for specifying physical properties for low +voltage commercial cables. New cables can be added by extending the +it. +

+

+For low voltage cables, only the characteristic resistance and reactance are +specified. +

+", revisions=" + +")); +end Generic; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl120.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl120.mo new file mode 100644 index 0000000000..1b2076de07 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl120.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl120 "Aluminum cable 120mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=0.269e-003, + XCha=0.071e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 120mm^2. +This type of cable has the following properties +

+
+RCha = 0.269e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.071e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl120; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl120_ECM.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl120_ECM.mo new file mode 100644 index 0000000000..5a3fbdb9e4 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl120_ECM.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl120_ECM "Aluminum cable 120mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=0.278e-003, + XCha=0.071e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 120mm^2, ECM type. +This type of cable has the following properties +

+
+RCha = 0.278e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.071e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl120_ECM; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl150.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl150.mo new file mode 100644 index 0000000000..cbfdd62bad --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl150.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl150 "Aluminum cable 150mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=0.206e-003, + XCha=0.070e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 150mm^2. +This type of cable has the following properties +

+
+RCha = 0.206e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.070e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl150; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl16.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl16.mo new file mode 100644 index 0000000000..35c1809593 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl16.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl16 "Aluminum cable 16 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=2.105e-003, + XCha=0.076e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 16mm^2, ECM type. +This type of cable has the following properties +

+
+RCha = 2.105e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.076e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl16; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl16_ECM.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl16_ECM.mo new file mode 100644 index 0000000000..c2ca41d61e --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl16_ECM.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl16_ECM "Aluminum cable 16 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=2.105e-003, + XCha=0.076e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 16mm^2, ECM type. +This type of cable has the following properties +

+
+RCha = 2.105e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.076e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl16_ECM; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl25.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl25.mo new file mode 100644 index 0000000000..6a7ea60a6a --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl25.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl25 "Aluminum cable 25 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=1.292e-003, + XCha=0.075e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 25mm^2, ECM type. +This type of cable has the following properties +

+
+RCha = 1.292e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.075e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl25; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl25_ECM.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl25_ECM.mo new file mode 100644 index 0000000000..b7034697b0 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl25_ECM.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl25_ECM "Aluminum cable 25 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=1.32e-003, + XCha=0.075e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 25mm^2, ECM type. +This type of cable has the following properties +

+
+RCha = 1.320e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.075e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl25_ECM; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl35.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl35.mo new file mode 100644 index 0000000000..a7fe7de544 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl35.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl35 "Aluminum cable 35 mm^2" +extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=0.923e-003, + XCha=0.074e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 35mm^2, ECM type. +This type of cable has the following properties +

+
+RCha = 0.923e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.074e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl35; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl35_ECM.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl35_ECM.mo new file mode 100644 index 0000000000..f692149023 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl35_ECM.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl35_ECM "Aluminum cable 35 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=0.956e-003, + XCha=0.074e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 35mm^2, ECM type. +This type of cable has the following properties +

+
+RCha = 0.956e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.074e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl35_ECM; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl50.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl50.mo new file mode 100644 index 0000000000..235b691d8e --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl50.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl50 "Aluminum cable 50 mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=0.641e-003, + XCha=0.073e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 50mm^2. +This type of cable has the following properties +

+
+RCha = 0.641e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.073e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl50; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl70.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl70.mo new file mode 100644 index 0000000000..4c4a58d884 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl70.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl70 "Aluminum cable 70mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=0.5071e-003, + XCha=0.072e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 70mm^2. +This type of cable has the following properties +

+
+RCha = 0.5071e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.072e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl70; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl70_ECM.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl70_ECM.mo new file mode 100644 index 0000000000..004d364551 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl70_ECM.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl70_ECM "Aluminum cable 70mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=0.488e-003, + XCha=0.072e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 70mm^2, ECM type. +This type of cable has the following properties +

+
+RCha = 0.488e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.072e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl70_ECM; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl75.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl75.mo new file mode 100644 index 0000000000..75ff3ecc39 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl75.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl75 "Aluminum cable 75mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=0.431e-003, + XCha=0.072e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 75mm^2. +This type of cable has the following properties +

+
+RCha = 0.431e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.072e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl75; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl95.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl95.mo new file mode 100644 index 0000000000..1ea5f58174 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/PvcAl95.mo @@ -0,0 +1,30 @@ +within IBPSA.Electrical.Transmission.LowVoltageCables; +record PvcAl95 "Aluminum cable 95mm^2" + extends IBPSA.Electrical.Transmission.LowVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + RCha=0.320e-003, + XCha=0.072e-003); + annotation (Documentation(info=" +

+Aluminium cable with a cross-sectional area of 95mm^2. +This type of cable has the following properties +

+
+RCha = 0.320e-003 // Characteristic resistance [Ohm/m]
+XCha = 0.072e-003 // Characteristic reactance [Ohm/m]
+
+", revisions=" + +")); +end PvcAl95; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/package.mo b/IBPSA/Electrical/Transmission/LowVoltageCables/package.mo new file mode 100644 index 0000000000..0be00a5d1d --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/package.mo @@ -0,0 +1,27 @@ +within IBPSA.Electrical.Transmission; +package LowVoltageCables "Package of low voltage electricity cables used in distribution grid" + extends Modelica.Icons.MaterialPropertiesPackage; + +annotation (Documentation(info=" +

+This package contains records of physical properties for low +voltage commercial cables. New cables can be added by extending the +base record + +IBPSA.Electrical.Transmission.LowVoltageCables.Generic. +

+

+For low voltage cables, only the characteristic resistance and reactance are +specified. See +IBPSA.Electrical.Transmission.Base.BaseCable for a comprehensive list of +parameters that can be specified for a cable. +

+", revisions=" + +")); +end LowVoltageCables; diff --git a/IBPSA/Electrical/Transmission/LowVoltageCables/package.order b/IBPSA/Electrical/Transmission/LowVoltageCables/package.order new file mode 100644 index 0000000000..945d5c3614 --- /dev/null +++ b/IBPSA/Electrical/Transmission/LowVoltageCables/package.order @@ -0,0 +1,22 @@ +Cu10 +Cu100 +Cu20 +Cu25 +Cu35 +Cu50 +Cu95 +Generic +PvcAl120 +PvcAl120_ECM +PvcAl150 +PvcAl16 +PvcAl16_ECM +PvcAl25 +PvcAl25_ECM +PvcAl35 +PvcAl35_ECM +PvcAl50 +PvcAl70 +PvcAl70_ECM +PvcAl75 +PvcAl95 diff --git a/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_10.mo b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_10.mo new file mode 100644 index 0000000000..7756cc3b38 --- /dev/null +++ b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_10.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.Transmission.MediumVoltageCables; +record Annealed_Al_10 "Annealed Al cable - AWG 1/0" + extends IBPSA.Electrical.Transmission.MediumVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + size="1/0", + Rdc=0.551181e-3, + T_ref=298.15, + d=9.195e-3, + D=26.543e-3, + GMR=IBPSA.Electrical.Transmission.Functions.computeGMR(d), + GMD=IBPSA.Electrical.Transmission.Functions.computeGMD(0.1905), + Amp=195); + annotation (Documentation(info=" +

+Annealed aluminium cable with a cross-sectional AWG 1/0 +(American Wire Gauge). +This type of cable has the following properties +

+
+Rdc  = 0.551181e-3 // Characteristic DC resistance at T = T_ref[Ohm/m]
+T_ref= 298.15      // Reference temperature of the material [K]
+d    = 9.195e-3    // Inner diameter [m]
+D    = 26.543e-3   // Outer diameter [m]
+Amp  = 195         // Ampacity [A]
+
+", revisions=" + +")); +end Annealed_Al_10; diff --git a/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_1000.mo b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_1000.mo new file mode 100644 index 0000000000..3fa5a79e38 --- /dev/null +++ b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_1000.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.Transmission.MediumVoltageCables; +record Annealed_Al_1000 "Annealed Al cable - AWG 1000" + extends IBPSA.Electrical.Transmission.MediumVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + size="1000", + Rdc=5.80709e-5, + T_ref=298.15, + d=28.372e-3, + D=46.101e-3, + GMR=IBPSA.Electrical.Transmission.Functions.computeGMR(d), + GMD=IBPSA.Electrical.Transmission.Functions.computeGMD(0.1905), + Amp=640); + annotation (Documentation(info=" +

+Annealed aluminium cable with a cross-sectional kcmil 1000 +(thousand of Circular Mils). +This type of cable has the following properties +

+
+Rdc  = 5.80709e-5  // Characteristic DC resistance at T = T_ref[Ohm/m]
+T_ref= 298.15      // Reference temperature of the material [K]
+d    = 28.372e-3   // Inner diameter [m]
+D    = 46.101e-3   // Outer diameter [m]
+Amp  = 640         // Ampacity [A]
+
+", revisions=" + +")); +end Annealed_Al_1000; diff --git a/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_1500.mo b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_1500.mo new file mode 100644 index 0000000000..feed18458e --- /dev/null +++ b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_1500.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.Transmission.MediumVoltageCables; +record Annealed_Al_1500 "Annealed Al cable - AWG 1500" + extends IBPSA.Electrical.Transmission.MediumVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + size="1500", + Rdc=3.87139e-5, + T_ref=298.15, + d=34.798e-3, + D=53.34e-3, + GMR=IBPSA.Electrical.Transmission.Functions.computeGMR(d), + GMD=IBPSA.Electrical.Transmission.Functions.computeGMD(0.1905), + Amp=800); + annotation (Documentation(info=" +

+Annealed aluminium cable with a cross-sectional kcmil 1500 +(thousand of Circular Mils). +This type of cable has the following properties +

+
+Rdc  = 3.87139e-5 // Characteristic DC resistance at T = T_ref[Ohm/m]
+T_ref= 298.15      // Reference temperature of the material [K]
+d    = 34.798e-3   // Inner diameter [m]
+D    = 53.34e-3   // Outer diameter [m]
+Amp  = 800         // Ampacity [A]
+
+", revisions=" + +")); +end Annealed_Al_1500; diff --git a/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_30.mo b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_30.mo new file mode 100644 index 0000000000..10c35e886c --- /dev/null +++ b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_30.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.Transmission.MediumVoltageCables; +record Annealed_Al_30 "Annealed Al cable - AWG 3/0" + extends IBPSA.Electrical.Transmission.MediumVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + size="3/0", + Rdc=0.344488e-3, + T_ref=298.15, + d=11.582e-3, + D=28.956e-3, + GMR=IBPSA.Electrical.Transmission.Functions.computeGMR(d), + GMD=IBPSA.Electrical.Transmission.Functions.computeGMD(0.1905), + Amp=250); + annotation (Documentation(info=" +

+Annealed aluminium cable with a cross-sectional AWG 2/0 +(American Wire Gauge). +This type of cable has the following properties +

+
+Rdc  = 0.344488e-3 // Characteristic DC resistance at T = T_ref[Ohm/m]
+T_ref= 298.15      // Reference temperature of the material [K]
+d    = 11.582e-3   // Inner diameter [m]
+D    = 28.956e-3   // Outer diameter [m]
+Amp  = 250         // Ampacity [A]
+
+", revisions=" + +")); +end Annealed_Al_30; diff --git a/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_350.mo b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_350.mo new file mode 100644 index 0000000000..d150bca0dc --- /dev/null +++ b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_350.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.Transmission.MediumVoltageCables; +record Annealed_Al_350 "Annealed Al cable - kcmil 350" + extends IBPSA.Electrical.Transmission.MediumVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + size="350", + Rdc=0.165682e-3, + T_ref=298.15, + d=16.789e-3, + D=34.417e-3, + GMR=IBPSA.Electrical.Transmission.Functions.computeGMR(d), + GMD=IBPSA.Electrical.Transmission.Functions.computeGMD(0.1905), + Amp=375); + annotation (Documentation(info=" +

+Annealed aluminium cable with a cross-sectional kcmil 350 +(thousand of Circular Mils). +This type of cable has the following properties +

+
+Rdc  = 0.165682e-3 // Characteristic DC resistance at T = T_ref[Ohm/m]
+T_ref= 298.15      // Reference temperature of the material [K]
+d    = 16.789e-3   // Inner diameter [m]
+D    = 34.417e-3   // Outer diameter [m]
+Amp  = 375         // Ampacity [A]
+
+", revisions=" + +")); +end Annealed_Al_350; diff --git a/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_40.mo b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_40.mo new file mode 100644 index 0000000000..3acf33ab66 --- /dev/null +++ b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_40.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.Transmission.MediumVoltageCables; +record Annealed_Al_40 "Annealed Al cable - AWG 4/0" + extends IBPSA.Electrical.Transmission.MediumVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + size="4/0", + Rdc=0.274278e-3, + T_ref=298.15, + d=13.005e-3, + D=30.353e-3, + GMR=IBPSA.Electrical.Transmission.Functions.computeGMR(d), + GMD=IBPSA.Electrical.Transmission.Functions.computeGMD(0.1905), + Amp=285); + annotation (Documentation(info=" +

+Annealed aluminium cable with a cross-sectional AWG 4/0 +(American Wire Gauge). +This type of cable has the following properties +

+
+Rdc  = 0.274278e-3 // Characteristic DC resistance at T = T_ref[Ohm/m]
+T_ref= 298.15      // Reference temperature of the material [K]
+d    = 13.005e-3   // Inner diameter [m]
+D    = 30.353e-3   // Outer diameter [m]
+Amp  = 285         // Ampacity [A]
+
+", revisions=" + +")); +end Annealed_Al_40; diff --git a/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_500.mo b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_500.mo new file mode 100644 index 0000000000..0ae4ee8634 --- /dev/null +++ b/IBPSA/Electrical/Transmission/MediumVoltageCables/Annealed_Al_500.mo @@ -0,0 +1,40 @@ +within IBPSA.Electrical.Transmission.MediumVoltageCables; +record Annealed_Al_500 "Annealed Al cable - AWG 500" + extends IBPSA.Electrical.Transmission.MediumVoltageCables.Generic( + material=Types.Material.Al, + M = 228.1 + 273.15, + size="500", + Rdc=0.116142e-3, + T_ref=298.15, + d=20.066e-3, + D=37.592e-3, + GMR=IBPSA.Electrical.Transmission.Functions.computeGMR(d), + GMD=IBPSA.Electrical.Transmission.Functions.computeGMD(0.1905), + Amp=450); + annotation (Documentation(info=" +

+Annealed aluminium cable with a cross-sectional kcmil 500 +(thousand of Circular Mils). +This type of cable has the following properties +

+
+Rdc  = 0.116142e-3 // Characteristic DC resistance at T = T_ref[Ohm/m]
+T_ref= 298.15      // Reference temperature of the material [K]
+d    = 20.066e-3   // Inner diameter [m]
+D    = 37.592e-3   // Outer diameter [m]
+Amp  = 450         // Ampacity [A]
+
+", revisions=" + +")); +end Annealed_Al_500; diff --git a/IBPSA/Electrical/Transmission/MediumVoltageCables/Generic.mo b/IBPSA/Electrical/Transmission/MediumVoltageCables/Generic.mo new file mode 100644 index 0000000000..6e19524fe4 --- /dev/null +++ b/IBPSA/Electrical/Transmission/MediumVoltageCables/Generic.mo @@ -0,0 +1,156 @@ +within IBPSA.Electrical.Transmission.MediumVoltageCables; +record Generic "Data record for a generic medium voltage cable" + extends Modelica.Icons.MaterialProperty; + extends IBPSA.Electrical.Transmission.BaseClasses.BaseCable; + parameter String size(start="") + "AWG or kcmil code representing the conductor size"; + parameter IBPSA.Electrical.Types.CharacteristicResistance Rdc(start=0) + "Characteristic DC resistance of the cable @ T_ref"; + parameter Modelica.Units.SI.Length d "Inner diameter"; + parameter Modelica.Units.SI.Length D "Outer diameter"; + parameter Modelica.Units.SI.Length GMR "Geometrical Mean Radius of the cable"; + parameter Modelica.Units.SI.Length GMD + "Geometrical Mean Diameter of the cable"; + + redeclare function extends lineResistance + "Function that computes the resistance of a cable" + input IBPSA.Electrical.Transmission.MediumVoltageCables.Generic cable + "Record that contains cable properties"; + algorithm + R := l*cable.Rdc*IBPSA.Electrical.Transmission.Functions.R_AC_correction( + cable.size, cable.material); + annotation(Inline=true, Documentation(revisions=" + +", info=" +

+This function computes the overall resistance of a cable. +

+

+When the voltage level is medium or high, the cables have a DC resistance that needs +to be corrected to account for the effects cause by the AC voltage. +The correction is +

+

+R = lCABLE RDC fCORR(s, m), +

+

+where RDC is the characteristic DC resistance per unit length, +lCABLE is the length of the cable, and +fCORR(s, m) is a function that corrects the DC value and depends on the +size of the cable s and its material m. See + +IBPSA.Electrical.Transmission.Functions.R_AC_correction for more details. +

+ +")); + end lineResistance; + + redeclare function extends lineInductance + "Function that computes the resistance of a cable" + input IBPSA.Electrical.Transmission.MediumVoltageCables.Generic cable + "Record that contains cable properties"; + algorithm + L := l*2e-7*log(cable.GMD/cable.GMR); + annotation(Inline=true, Documentation(revisions=" + +", info=" +

+This function computes the overall inductance of a cable. +

+

+When the voltage level is medium or high, the cables have geometric parameters that can +be used to compute the inductance as +

+

+R = lCABLE 2 10-7 log(GMD/GMR), +

+

+where lCABLE is the length of the cable, and +GMD and GMR are the geometric mean distance and the geometric mean radius +of the cable. +

+")); + end lineInductance; + + redeclare function extends lineCapacitance + "Function that computes the capacitance of a cable" + input IBPSA.Electrical.Transmission.MediumVoltageCables.Generic cable + "Record that contains cable properties"; + protected + Modelica.Units.SI.Length r "Radius"; + algorithm + r := cable.d/2.0; + C := l*2*Modelica.Constants.pi*Modelica.Constants.epsilon_0/log(cable.GMD/r); + annotation(Inline=true, Documentation(revisions=" + +", info=" +

+This function computes the overall capacity of a cable. +

+

+When the voltage level is medium or high, the cables have geometric parameters that can +be used to compute the capacity as +

+

+C = lCABLE 2 π ε0/log(GMD/r), +

+

+where lCABLE is the length of the cable, +ε0 is the dielectric constant of the air, GMD +is the geometric mean distance, and r = d/2 where d is the inner +diameter of the cable. +

+")); + end lineCapacitance; + + annotation (Documentation(info=" +

+This is a base record for specifying physical properties for medium +voltage commercial cables. New cables can be added by extending +it. +

+

+For medium voltage cables, the geometric properties of the cable and the material are +specified. For example some of the properties that are specified are: +

+
+Rdc   : Characteristic DC resistance at T = T_ref[Ohm/m]
+T_ref : Reference temperature of the material [K]
+d     : Inner diameter [m]
+D     : Outer diameter [m]
+Amp   : Ampacity [A]
+
+

+other properties such as the geometric mean diameter GMD and the +geometric mean radius GMR are by default computed using functions, +but this can be overriden. +

+", revisions=" + +")); +end Generic; diff --git a/IBPSA/Electrical/Transmission/MediumVoltageCables/package.mo b/IBPSA/Electrical/Transmission/MediumVoltageCables/package.mo new file mode 100644 index 0000000000..89f3a28727 --- /dev/null +++ b/IBPSA/Electrical/Transmission/MediumVoltageCables/package.mo @@ -0,0 +1,22 @@ +within IBPSA.Electrical.Transmission; +package MediumVoltageCables "Package of medium voltage electricity cables used in distribution grid" + extends Modelica.Icons.MaterialPropertiesPackage; + + +annotation (Documentation(info=" +

+This package contains records of physical properties of medium +voltage commercial cables. New cables can be added by extending the +base record + +IBPSA.Electrical.Transmission.MediumVoltageCables.Generic. +

+", revisions=" + +")); +end MediumVoltageCables; diff --git a/IBPSA/Electrical/Transmission/MediumVoltageCables/package.order b/IBPSA/Electrical/Transmission/MediumVoltageCables/package.order new file mode 100644 index 0000000000..bbbc0da18c --- /dev/null +++ b/IBPSA/Electrical/Transmission/MediumVoltageCables/package.order @@ -0,0 +1,8 @@ +Annealed_Al_10 +Annealed_Al_1000 +Annealed_Al_1500 +Annealed_Al_30 +Annealed_Al_350 +Annealed_Al_40 +Annealed_Al_500 +Generic diff --git a/IBPSA/Electrical/Transmission/Types/Material.mo b/IBPSA/Electrical/Transmission/Types/Material.mo new file mode 100644 index 0000000000..f984d21b66 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Types/Material.mo @@ -0,0 +1,16 @@ +within IBPSA.Electrical.Transmission.Types; +type Material = enumeration( + Cu "Copper", + Al "Aluminium") "Material of the cable" annotation (Documentation(revisions=" + +", info=" +

+Enumeration for materials that can be used +for cables. +

+")); diff --git a/IBPSA/Electrical/Transmission/Types/package.mo b/IBPSA/Electrical/Transmission/Types/package.mo new file mode 100644 index 0000000000..27fa5a8d27 --- /dev/null +++ b/IBPSA/Electrical/Transmission/Types/package.mo @@ -0,0 +1,19 @@ +within IBPSA.Electrical.Transmission; +package Types "Package that contains cables materials" + extends Modelica.Icons.TypesPackage; + + +annotation (preferredView="info", +Documentation(info=" +

+This package contains an enumeration for materials. +

+", revisions=" + +")); +end Types; diff --git a/IBPSA/Electrical/Transmission/Types/package.order b/IBPSA/Electrical/Transmission/Types/package.order new file mode 100644 index 0000000000..f4c8dcd2bc --- /dev/null +++ b/IBPSA/Electrical/Transmission/Types/package.order @@ -0,0 +1 @@ +Material diff --git a/IBPSA/Electrical/Transmission/package.mo b/IBPSA/Electrical/Transmission/package.mo new file mode 100644 index 0000000000..49b27cb1bb --- /dev/null +++ b/IBPSA/Electrical/Transmission/package.mo @@ -0,0 +1,74 @@ +within IBPSA.Electrical; +package Transmission "Package with models for transmission lines" + extends Modelica.Icons.Package; + +annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={ + Ellipse( + extent={{40,8},{16,-28}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{28,8},{-54,8},{-64,8},{-72,-10},{-64,-28},{-52,-28},{28,-28}}, + color={0,0,0}, + smooth=Smooth.Bezier), + Line( + points={{-70,-10},{-88,-10}}, + color={0,0,0}, + smooth=Smooth.None), + Line( + points={{54,-10},{28,-10}}, + color={0,0,0}, + smooth=Smooth.None)}), Documentation(info=" +

+This package contains cables that can be used +to represent a line in a electric grid. The package contains +several functions and records to parametrize cables either using +default values or values from commercial cables. +

+

+The package + +IBPSA.Electrical.Transmission.Grids +contains models of +electrical networks. +

+

Commercial cables

+

+The package contains several low voltage and medium voltage cable with +pre-defined physical and geometrical properties like characteristic resistances and +diameters. There are different conventions to measure the cables. +

+ +
Cross-sectional area
+

+A measure of cross-sectional area in square mm. E.g. 50 mm2 +wire has a nominal circula area of 50 mm2 and a diameter of +7.98 mm. +

+ +
AWG (American Wire Gauge)
+

+A measure of wire thickness (which also dictates cross-sectional area, and +for a given material, ampacity). E.g. 24 AWG wire has a nominal diameter of +0.0201 in or 0.511 mm. +

+ +
kcmil (thousand of Circular Mils)
+

+kcmil is an abbreviation for thousands of circular mils, an old measurement of +wire gauge. 1 kcmil = 0.5067 square millimeters. A mil is 1/1000 inch. +A wire 200 mils in diameter is 40 kcmil. kcmil is generally used for very +large-diameter wire. Most wires use AWG. +

+ +", revisions=" + +")); +end Transmission; diff --git a/IBPSA/Electrical/Transmission/package.order b/IBPSA/Electrical/Transmission/package.order new file mode 100644 index 0000000000..8954d8b84a --- /dev/null +++ b/IBPSA/Electrical/Transmission/package.order @@ -0,0 +1,6 @@ +Functions +Grids +LowVoltageCables +MediumVoltageCables +Types +BaseClasses diff --git a/IBPSA/Electrical/Types/CableMode.mo b/IBPSA/Electrical/Types/CableMode.mo new file mode 100644 index 0000000000..faa4671c22 --- /dev/null +++ b/IBPSA/Electrical/Types/CableMode.mo @@ -0,0 +1,18 @@ +within IBPSA.Electrical.Types; +type CableMode = enumeration( + automatic "Select automatically the size of the cable", + commercial "Select the cable from a list of commercial options") + "Enumeration that defines how a cable can be parameterized" annotation ( + Documentation(revisions=" + +", info=" +This type is used to indicate in which mode the cable model works. +In automatic mode the cable is automatically sized using basic information like +nominal voltage and power, in commercial mode the user can select among a list of +commercially available cables. +")); diff --git a/IBPSA/Electrical/Types/CharacteristicReactance.mo b/IBPSA/Electrical/Types/CharacteristicReactance.mo new file mode 100644 index 0000000000..e5dbdee11d --- /dev/null +++ b/IBPSA/Electrical/Types/CharacteristicReactance.mo @@ -0,0 +1,13 @@ +within IBPSA.Electrical.Types; +type CharacteristicReactance = Real (final quantity="Reactance per meter", final unit="Ohm/m") + "Reactance per unit length" annotation (Documentation(revisions=" + +", info=" +This type defines the reactance per unit length. It is typically used +to describe physical properties of line cables. +")); diff --git a/IBPSA/Electrical/Types/CharacteristicResistance.mo b/IBPSA/Electrical/Types/CharacteristicResistance.mo new file mode 100644 index 0000000000..0f24071de1 --- /dev/null +++ b/IBPSA/Electrical/Types/CharacteristicResistance.mo @@ -0,0 +1,13 @@ +within IBPSA.Electrical.Types; +type CharacteristicResistance = Real (final quantity="Resistance per meter", final unit="Ohm/m") + "Resistance per unit length" annotation (Documentation(revisions=" + +", info=" +This type defines the resistance per unit length and it typically used +to describe physical properties of the line cables. +")); diff --git a/IBPSA/Electrical/Types/InitMode.mo b/IBPSA/Electrical/Types/InitMode.mo new file mode 100644 index 0000000000..5bf9af426c --- /dev/null +++ b/IBPSA/Electrical/Types/InitMode.mo @@ -0,0 +1,16 @@ +within IBPSA.Electrical.Types; +type InitMode = enumeration( + zero_current "Assume i=0 during homotopy initialization", + linearized "Uses linear model during homotopy initialization") + "Enumeration that defines the type of initialization assumption can be used for a load model" + annotation (Documentation(revisions=" + +", info=" +This type is used to indicate how a model +should be initialized. +")); diff --git a/IBPSA/Electrical/Types/Load.mo b/IBPSA/Electrical/Types/Load.mo new file mode 100644 index 0000000000..a9b2e1d49d --- /dev/null +++ b/IBPSA/Electrical/Types/Load.mo @@ -0,0 +1,17 @@ +within IBPSA.Electrical.Types; +type Load = enumeration( + FixedZ_steady_state "Fixed Z, steady-state", + FixedZ_dynamic "Fixed Z, dynamic", + VariableZ_P_input "Variable Z, P input", + VariableZ_y_input "Variable Z, y input") + "Enumeration that defines the modeling assumption of the load." annotation ( + Documentation(revisions=" + +", info=" +This type indicates in which mode the load model operates. +")); diff --git a/IBPSA/Electrical/Types/LoadConnection.mo b/IBPSA/Electrical/Types/LoadConnection.mo new file mode 100644 index 0000000000..79860d28f9 --- /dev/null +++ b/IBPSA/Electrical/Types/LoadConnection.mo @@ -0,0 +1,16 @@ +within IBPSA.Electrical.Types; +type LoadConnection = enumeration( + wye_to_wyeg "Wye to wye grounded", + wye_to_delta "Wye to delta") + "Enumeration that defines the type of connection can be used for three-phase unbalanced systems" + annotation (Documentation(revisions=" + +", info=" +This type is used to describe different types of connections that can be used in +unbalanced three phase systems. +")); diff --git a/IBPSA/Electrical/Types/PerUnit.mo b/IBPSA/Electrical/Types/PerUnit.mo new file mode 100644 index 0000000000..80479dc305 --- /dev/null +++ b/IBPSA/Electrical/Types/PerUnit.mo @@ -0,0 +1,15 @@ +within IBPSA.Electrical.Types; +type PerUnit = Real (final quantity="Per unit", final unit="1", min=0) + "Used to represent electric quantities with respect to reference value" + annotation (Documentation(revisions=" + +", info=" +This type is used to declare whether an electric quantity such as voltage +is expressed in SI units or in per units (i.e., the value divided by its nominal +value). +")); diff --git a/IBPSA/Electrical/Types/VoltageLevel.mo b/IBPSA/Electrical/Types/VoltageLevel.mo new file mode 100644 index 0000000000..3b0b864053 --- /dev/null +++ b/IBPSA/Electrical/Types/VoltageLevel.mo @@ -0,0 +1,16 @@ +within IBPSA.Electrical.Types; +type VoltageLevel = enumeration( + Low "Low voltage", + Medium "Medium voltage", + High "High voltage") "Enumeration that defines the type of voltage level" + annotation (Documentation(revisions=" + +", info=" +This type is used to define which type of voltage level is used. +This is typically used for computing or selecting the line cables. +")); diff --git a/IBPSA/Electrical/Types/package.mo b/IBPSA/Electrical/Types/package.mo new file mode 100644 index 0000000000..70e176d6f8 --- /dev/null +++ b/IBPSA/Electrical/Types/package.mo @@ -0,0 +1,28 @@ +within IBPSA.Electrical; +package Types "This package contains new types used within the Electrical package" + extends Modelica.Icons.TypesPackage; + +annotation (preferredView="info", +Documentation( +info=" +This package contains type definitions. +", +revisions=" + +")); +end Types; diff --git a/IBPSA/Electrical/Types/package.order b/IBPSA/Electrical/Types/package.order new file mode 100644 index 0000000000..e17893b71e --- /dev/null +++ b/IBPSA/Electrical/Types/package.order @@ -0,0 +1,8 @@ +CableMode +CharacteristicReactance +CharacteristicResistance +InitMode +Load +LoadConnection +PerUnit +VoltageLevel diff --git a/IBPSA/Electrical/UsersGuide.mo b/IBPSA/Electrical/UsersGuide.mo new file mode 100644 index 0000000000..6490710f2f --- /dev/null +++ b/IBPSA/Electrical/UsersGuide.mo @@ -0,0 +1,275 @@ +within IBPSA.Electrical; +package UsersGuide "Electrical package user's guide" + extends Modelica.Icons.Information; + annotation (preferredView="info", +Documentation(info=" + +

Overview

+

+The IBPSA.Electrical package extends the +capabilities of the IBPSA library with models for electrical systems, allowing +to study building-to-grid integration such as the effect of large scale PV on the +voltage of the electrical distribution grid. +The package contains models for different types of sources, loads, storage equipment, +and transmission lines for electric power. The package contains models that can be used to +represent DC, AC one-phase, and AC three-phase balanced and unbalanced systems. +The models can be used to scale from the building level up to the distribution level. +The models have been successfully validated against the IEEE four nodes test feeder. +

+ +

Connectors

+

+The IBPSA.Electrical package uses a +new type of generalized connector that has been introduced by R. Franke and Wiesman (2014) +and is used by the Power Systems Library +and the +Electric Power Library. +

+

+The Modelica Standard Library (MSL) version 3.2.1 has different connectors depending on the +type of electric system being modeled. For example, DC and AC continuous time systems have +a connector (Modelica.Electrical.Analog.Interfaces.Pin) +that differs from the one used by AC models, which use the +quasi-stationary assumption ( +Modelica.Electrical.QuasiStationary.SinglePhase.Interfaces.Pin). +

+

+The generalized electrical connector overcomes this limitation. It uses a paradigm +that is similar to the one used by the Modelica.Fluid connectors. +The generalized connector is as follows: +

+ +

+connector + Terminal +"Generalized electric terminal" +

+

+extends +IBPSA.Electrical.Interfaces.BaseTerminal +; +

+

+replaceable package + PhaseSystem = +IBPSA.Electrical.PhaseSystems.PartialPhaseSystem +"Phase system" +; +

+

+PhaseSystem.Voltage + v[PhaseSystem.n] +"Voltage vector" +; +

+flow +PhaseSystem.Current + i[PhaseSystem.n] +"Current vector" +; +

+

+PhaseSystem.ReferenceAngle + theta[PhaseSystem.m] +"Optional vector of phase angles" +; +

+

+end +Terminal; +

+ +

+The connector has a package called PhaseSystem that contains constants, functions, +and equations of the specific electric domain. This allows to represent different electrical domains using the +same connector, reusing the same standardized interfaces. +

+ +

+As the electrical connectors of the Modelica Standard Library, the Terminal has a vector of voltages as effort variables and +a vector of currents as flow variables. The connector has an additional vector that represents the +reference angle theta[PhaseSystem.m]. If PhaseSystem.m > 0 the connector is overdetermined +because the number of effort variables is higher than the number of flow variables. +The over-determined connectors are defined and used in such a way that a Modelica tool is able +to remove the superfluous but consistent equations, arriving at a balanced set of equations based on a +graph analysis of the connection structure. The models in the library uses constructs specified +by the Modelica language to handle this situation Olsson Et Al. (2008). +

+ +

PhaseSystem

+ +

+The connector has a package called PhaseSystem that allows to represent different +electrical domains using the same connector, reusing the same standardized interfaces. +The available PhaseSystems are contained in the package + +IBPSA.Electrical.PhaseSystems. +

+

+Each of the available packages represent a different type of electrical systems. +The electrical systems represented are: +

+ + +

Linearized models and homotopy initialization

+

+\"image\" +

+

+Consider the simple DC circuit shown above, where VS is a +constant voltage source and R is a line resistance. The load has a voltage V across +its electrical pins and a current i. If the power consumed +by the load is PLOAD, the equation that describes the circuit is nonlinear. +

+ +

+\"image\" +

+ +

+If the number of loads increases, as typically happens in grid simulations, the size of the system of +nonlinear equations to be solved increases too, causing the numerical solver to slow the simulation. +A linearized load model can solve such a problem. All the load models in the +IBPSA.Electrical package have a linearized version. +The linearized version of the model can be selected by setting the boolean flag linearized = true. +Details about the implementation of the linearized models can be found in +IBPSA.Electrical.DC.Loads.Conductor +or +IBPSA.Electrical.AC.OnePhase.Loads.Resistive. +

+ +

+When multiple loads are connected in a grid through cables that cause voltage drops, +the dimension of the system of nonlinear equations increases linearly with the number of loads. +This nonlinear system of equations introduces challenges during the initialization, as Newton solvers +may diverge if initialized far from a solution. +The initialization problem can be simplified using the homotopy +operator. The homotopy operator uses two different types of equations to compute the value of a +variable: the actual one and a simplified one. The actual equation is the one used during the normal +operation. During initialization, the simplified equation is first solved and then slowly replaced with the +actual equation to compute the initial values for the nonlinear systems of equations. +The load model uses the homotopy operator, with the linearized model being used +as the simplified equation. This numerical expedient has proven useful +when simulating models with more than ten connected loads. +All the load models of the IBPSA.Electrical package use the +the homotopy operator during the initialization. The parameter initMode is used to select which +simplified equation should be used by the homotopy operator: +

+ + +

Nominal values

+

+Most components have a parameters for the nominal operating conditions. +These parameters have names that end in _nominal and +they should be set to the values that the component typically +have if they are run at design conditions. Depending on the model, these +parameters are used differently, and the respective model documentation or code +should be consulted for details. However, the table below shows the typical use of +the parameters in various models to help the user understand how they are used. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterModelFunctionality
V_nominal
+ P_nominal
Load models + V_nominal is the RMS (Root Mean Square) voltage at which the load consumes the + nominal real power (measured in [W]) P_nominal. + When the load model are linearized, the linearization is done for V = V_nominal. +
V_nominal
+ P_nominal
Transmission line models + + V_nominal is the RMS (Root Mean Square) voltage at which the line operates + while P_nominal is the power flowing through it. These values are used in some + cases to automatically select the right cable properties. +
V_nominalStorage
+ PVs
+ Wind turbine +
+ V_nominal is the RMS (Root Mean Square) voltage at which these components + typically operate. Since these model contain load models, V_nominal can be used + for linearization purposes. +
V_nominalSensors + V_nominal is the RMS (Root Mean Square) voltage of the system + that is currently measured, it can be used to measure quantities in per unit [pu]. +
+ +

Other information

+

+Other information about the models and the packages can be found in the +info section of each model or sub-packages. +

+ +

Awards

+

+The paper titled +A Modelica package for building-to-electrical grid integration won the best paper +award at the BauSIM 2014 conference. +

+ +

References

+

+ +Marco Bonvini, Michael Wetter, and Thierry Stephane Nouidui.
+
+A Modelica package for building-to-electrical grid integration
+BauSIM 2014 Conference, Aachen, Germany, September 2014.
+

+ +

+ +Rudiger Franke and Hansjorg Wiesmann.
+
+Flexible modeling of electrical power systems - the Modelica PowerSystems library.
+Proc. of the 10th Modelica Conference, Lund, Sweden, March 2014.
+

+ +

+ +Hans Olsson, Martin Otter, Sven Erik Mattson and Hilding Elmqvist.
+
+Balanced Models in Modelica 3.0 for Increased Model Quality.
+Proc. of the 7th Modelica Conference, Bielefeld, Germany, March 2008.
+

+", revisions=" + +")); +end UsersGuide; diff --git a/IBPSA/Electrical/package.mo b/IBPSA/Electrical/package.mo index d39c3c4fa3..76752d6ec5 100644 --- a/IBPSA/Electrical/package.mo +++ b/IBPSA/Electrical/package.mo @@ -1,34 +1,20 @@ within IBPSA; -package Electrical "Package with models for electrical systems and components" +package Electrical "Package with models for electrical systems" extends Modelica.Icons.Package; -annotation (Icon(graphics={ - Rectangle( - lineColor={128,128,128}, - extent={{-100,-100},{100,100}}, - radius=25.0), - Rectangle( - origin={20.3125,82.8571}, - extent={{-45.3125,-57.8571},{4.6875,-27.8571}}), - Line( - origin={8,48}, - points={{32.0,-58.0},{72.0,-58.0}}), - Line( - origin={9,54}, - points={{31.0,-49.0},{71.0,-49.0}}), - Line( - origin={-2,55}, - points={{-83.0,-50.0},{-33.0,-50.0}}), - Line( - origin={-3,45}, - points={{-72.0,-55.0},{-42.0,-55.0}}), - Line( - origin={1,50}, - points={{-61.0,-45.0},{-61.0,-10.0},{-26.0,-10.0}}), - Line( - origin={7,50}, - points={{18.0,-10.0},{53.0,-10.0},{53.0,-45.0}}), - Line( - origin={6.2593,48}, - points={{53.7407,-58.0},{53.7407,-93.0},{-66.2593,-93.0},{-66.2593,-58.0}})})); + +annotation (Documentation(info=" +

+This package contains models for both DC and AC electrical systems. +

+"), Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}}), graphics={Line( + points={{32,80},{-36,12},{24,12},{-58,-74},{-58,-74}}, + color={0,0,0}, + smooth=Smooth.None), Polygon( + points={{-58,-74},{-42,-24},{-8,-56},{-58,-74}}, + lineColor={0,0,0}, + smooth=Smooth.None, + fillPattern=FillPattern.Solid, + fillColor={0,0,0})})); end Electrical; diff --git a/IBPSA/Electrical/package.order b/IBPSA/Electrical/package.order index 31f903d8b0..e287da516a 100644 --- a/IBPSA/Electrical/package.order +++ b/IBPSA/Electrical/package.order @@ -1,5 +1,13 @@ DataBase PVSystem BaseClasses +UsersGuide +AC +DC +Icons +PhaseSystems +Transmission +Types +Interfaces Examples -Validation +Validation \ No newline at end of file