model ConstantFlux "Source of constant magnetic flux"
extends Interfaces.PartialTwoPort;
parameter Modelica.SIunits.Frequency f(start = 1) "Frequency of the source";
Modelica.SIunits.ComplexMagneticPotentialDifference V_m "Complex magnetic potential difference";
Modelica.SIunits.MagneticPotentialDifference abs_V_m = Modelica.ComplexMath.'abs'(V_m) "Magnitude of complex magnetic potential difference";
Modelica.SIunits.Angle arg_V_m = Modelica.ComplexMath.arg(V_m) "Argument of complex magnetic potential difference";
parameter Modelica.SIunits.ComplexMagneticFlux Phi = Complex(re = 1, im = 0) "Complex magnetic flux";
Modelica.SIunits.MagneticPotentialDifference abs_Phi = Modelica.ComplexMath.'abs'(Phi) "Magnitude of complex magnetic flux";
Modelica.SIunits.Angle arg_Phi = Modelica.ComplexMath.arg(Phi) "Argument of complex magnetic flux";
equation
Connections.root(port_p.reference);
port_p.Phi + port_n.Phi = Complex(0, 0);
omega = 2 * Modelica.Constants.pi * f;
port_p.Phi = Phi;
port_p.V_m - port_n.V_m = V_m;
annotation (
defaultComponentName = "magFluxSource",
Icon(
coordinateSystem(
preserveAspectRatio = false,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Ellipse(
extent = {
{-50, -50},
{50, 50}},
lineColor = {255, 127, 0},
fillColor = {255, 255, 255},
fillPattern = FillPattern.Solid),
Line(
points = {
{100, 0},
{50, 0}},
color = {255, 127, 0}),
Line(
points = {
{-50, 0},
{-100, 0}},
color = {255, 127, 0}),
Line(
points = {
{0, 50},
{0, -50}},
color = {255, 127, 0}),
Polygon(
points = {
{80, 0},
{60, 6},
{60, -6},
{80, 0}},
lineColor = {255, 170, 85},
fillColor = {255, 170, 85},
fillPattern = FillPattern.Solid),
Text(
extent = {
{150, 110},
{-150, 70}},
lineColor = {0, 0, 255},
textString = "%name")}),
Documentation(info = "<html>\n<p>\nSource of constant magnetic flux.\n</p>\n\n<h4>See also</h4>\n<p>\n<a href=\"modelica://Modelica.Magnetic.QuasiStatic.FundamentalWave.Sources.ConstantMagneticPotentialDifference\">\nConstantMagneticPotentialDifference</a>,\n<a href=\"modelica://Modelica.Magnetic.QuasiStatic.FundamentalWave.Sources.SignalMagneticPotentialDifference\">\nSignalMagneticPotentialDifference</a>,\n<a href=\"modelica://Modelica.Magnetic.QuasiStatic.FundamentalWave.Sources.SignalFlux\">\nSignalFlux</a>\n</p>\n\n</html>"));
end ConstantFlux;