|
| 1 | +within IBPSA.Electrical.AC.OnePhase.Conversion; |
| 2 | +model ACACConverter "AC AC converter single phase systems" |
| 3 | + extends IBPSA.Electrical.Icons.RefAngleConversion; |
| 4 | + extends IBPSA.Electrical.Interfaces.PartialConversion( |
| 5 | + redeclare package PhaseSystem_p = PhaseSystems.OnePhase, |
| 6 | + redeclare package PhaseSystem_n = PhaseSystems.OnePhase, |
| 7 | + redeclare replaceable Interfaces.Terminal_n terminal_n |
| 8 | + constrainedby Interfaces.Terminal_n( |
| 9 | + i(start = zeros(PhaseSystem_n.n), |
| 10 | + each stateSelect = StateSelect.prefer)), |
| 11 | + redeclare replaceable Interfaces.Terminal_p terminal_p |
| 12 | + constrainedby Interfaces.Terminal_p( |
| 13 | + i(start = zeros(PhaseSystem_p.n), |
| 14 | + each stateSelect = StateSelect.prefer))); |
| 15 | + parameter Real conversionFactor(min = Modelica.Constants.eps) |
| 16 | + "Ratio of QS rms voltage on side 2 / QS rms voltage on side 1"; |
| 17 | + parameter Real eta(min=0, max=1) |
| 18 | + "Converter efficiency, pLoss = (1-eta) * Ptr"; |
| 19 | + parameter Boolean ground_1 = false |
| 20 | + "If true, connect side 1 of converter to ground" |
| 21 | + annotation(Evaluate=true,Dialog(tab = "Ground", group="side 1")); |
| 22 | + parameter Boolean ground_2 = true |
| 23 | + "If true, connect side 2 of converter to ground" |
| 24 | + annotation(Evaluate=true, Dialog(tab = "Ground", group="side 2")); |
| 25 | + Modelica.Units.SI.Power LossPower[2] "Loss power"; |
| 26 | +protected |
| 27 | + Modelica.Units.SI.Power P_p[2]=PhaseSystem_p.phasePowers_vi(terminal_p.v, |
| 28 | + terminal_p.i) "Power transmitted at pin p"; |
| 29 | + Modelica.Units.SI.Power P_n[2]=PhaseSystem_n.phasePowers_vi(terminal_n.v, |
| 30 | + terminal_n.i) "Power transmitted at pin n"; |
| 31 | +equation |
| 32 | + |
| 33 | + // Ideal transformation |
| 34 | + terminal_p.v = conversionFactor*terminal_n.v; |
| 35 | + |
| 36 | + // Power loss term |
| 37 | + terminal_p.i[1] = terminal_n.i[1]/conversionFactor* |
| 38 | + IBPSA.Utilities.Math.Functions.spliceFunction(eta-2, 1/(eta-2), P_p[1], deltax=0.1); |
| 39 | + terminal_p.i[2] = terminal_n.i[2]/conversionFactor* |
| 40 | + IBPSA.Utilities.Math.Functions.spliceFunction(eta-2, 1/(eta-2), P_p[1], deltax=0.1); |
| 41 | + LossPower = P_p + P_n; |
| 42 | + |
| 43 | + // The two sides have the same reference angle |
| 44 | + terminal_p.theta = terminal_n.theta; |
| 45 | + |
| 46 | + if ground_1 then |
| 47 | + Connections.potentialRoot(terminal_n.theta); |
| 48 | + end if; |
| 49 | + if ground_2 then |
| 50 | + Connections.root(terminal_p.theta); |
| 51 | + end if; |
| 52 | + |
| 53 | + annotation ( |
| 54 | + defaultComponentName="conACAC", |
| 55 | + Icon(coordinateSystem(preserveAspectRatio=false, |
| 56 | + extent={{-100,-100},{100,100}}), |
| 57 | + graphics={ |
| 58 | + Line( |
| 59 | + points={{2,60},{2,60},{82,60},{2,60},{82,-60},{2,-60},{2,60},{2,-60}}, |
| 60 | + color={0,120,120}, |
| 61 | + smooth=Smooth.None), |
| 62 | + Line( |
| 63 | + points={{-2,60},{-2,60},{-82,60},{-2,60},{-82,-60},{-2,-60},{-2,60},{ |
| 64 | + -2,-60}}, |
| 65 | + color={11,193,87}, |
| 66 | + smooth=Smooth.None), |
| 67 | + Text( |
| 68 | + extent={{-100,92},{100,60}}, |
| 69 | + textColor={0,0,0}, |
| 70 | + textString="%name"), |
| 71 | + Text( |
| 72 | + extent={{-100,-60},{100,-92}}, |
| 73 | + textColor={0,0,0}, |
| 74 | + textString="%conversionFactor"), |
| 75 | + Text( |
| 76 | + extent={{-100,-100},{100,-132}}, |
| 77 | + textColor={0,120,120}, |
| 78 | + textString="%eta"), |
| 79 | + Text( |
| 80 | + extent={{-132,78},{-72,38}}, |
| 81 | + textColor={11,193,87}, |
| 82 | + textString="1"), |
| 83 | + Text( |
| 84 | + extent={{-88,52},{-28,12}}, |
| 85 | + textColor={11,193,87}, |
| 86 | + textString="AC"), |
| 87 | + Text( |
| 88 | + extent={{32,52},{92,12}}, |
| 89 | + textColor={0,120,120}, |
| 90 | + textString="AC"), |
| 91 | + Text( |
| 92 | + extent={{70,78},{130,38}}, |
| 93 | + textColor={0,120,120}, |
| 94 | + textString="2")}), |
| 95 | + Documentation(info="<html> |
| 96 | +<p> |
| 97 | +This is an AC/AC converter, based on a power balance between both circuit sides. |
| 98 | +The parameter <i>conversionFactor</i> defines the ratio between the RMS voltages |
| 99 | +as |
| 100 | +</p> |
| 101 | +
|
| 102 | +<p align=\"center\" style=\"font-style:italic;\"> |
| 103 | +V<sub>2</sub> = conversionFactor V<sub>1</sub> |
| 104 | +</p> |
| 105 | +
|
| 106 | +<p> |
| 107 | +where <i>V<sub>1</sub></i> and <i>V<sub>2</sub></i> are the RMS voltages |
| 108 | +at the primary and secondary sides of the transformer, i.e., the |
| 109 | +connector N and P, respectively. |
| 110 | +</p> |
| 111 | +
|
| 112 | +<p> |
| 113 | +The loss of the converter is proportional to the power transmitted. |
| 114 | +The parameter <code>eta</code> is the efficiency of the transfer. |
| 115 | +The loss is computed as |
| 116 | +</p> |
| 117 | +<p align=\"center\" style=\"font-style:italic;\"> |
| 118 | +P<sub>loss</sub> = (1-η) P<sub>tr</sub>, |
| 119 | +</p> |
| 120 | +<p> |
| 121 | +where <i>P<sub>tr</sub></i> is the power transmitted. The model is bi-directional |
| 122 | +and the power can flow from the primary to the secondary side and vice-versa. |
| 123 | +Furthermore, reactive power on both side are set to zero. |
| 124 | +</p> |
| 125 | +<h4>Note:</h4> |
| 126 | +<p> |
| 127 | +This model is derived from |
| 128 | +<a href=\"modelica://Modelica.Electrical.QuasiStationary.SinglePhase.Utilities.IdealACDCConverter\"> |
| 129 | +Modelica.Electrical.QuasiStationary.SinglePhase.Utilities.IdealACDCConverter</a>. |
| 130 | +</p> |
| 131 | +</html>", revisions="<html> |
| 132 | +<ul> |
| 133 | +<li> |
| 134 | +January 30, 2019, by Michael Wetter:<br/> |
| 135 | +Added missing <code>replaceable</code> for the terminal. |
| 136 | +</li> |
| 137 | +<li> |
| 138 | +September 4, 2014, by Michael Wetter:<br/> |
| 139 | +Revised model. |
| 140 | +</li> |
| 141 | +<li> |
| 142 | +August 5, 2014, by Marco Bonvini:<br/> |
| 143 | +Revised documentation. |
| 144 | +</li> |
| 145 | +<li> |
| 146 | +June 9, 2014, by Marco Bonvini:<br/> |
| 147 | +Revised implementation and added <code>stateSelect</code> statement to use |
| 148 | +the current <code>i[:]</code> on the connectors as iteration variable for the |
| 149 | +initialization problem. |
| 150 | +</li> |
| 151 | +<li> |
| 152 | +January 29, 2012, by Thierry S. Nouidui:<br/> |
| 153 | +First implementation. |
| 154 | +</li> |
| 155 | +</ul> |
| 156 | +</html>")); |
| 157 | +end ACACConverter; |
0 commit comments