Reputation: 51
I am trying to model a network of pipes that will transport air in Openmodelica Fluid library. I tried the "Pump", "ControlledPump" and "PrescribedPump" from Fluid.Machines and read the descriptions but can't get any of them to work.
Ideally I would like to enter the performance curve in the model like the PQ-curve in this page:
coolingfans
It does not have to be very precise it is for an early design study to test some alternative layouts with one or more fans. Just a couple of points to approximate the curve would be fine.
Ive tried modifying examples but I'm lost. I'm not sure what pump to use and how to set it up properly.
To get some flow through the ducts (StaticPipe) I created a source and sink with a different pressure. And connected them with some pipes. That simulates ok. But how to add a proper fan or punp?
model flowTest01
inner Modelica.Fluid.System system(p_ambient(displayUnit = "Pa")) annotation(
Placement(visible = true, transformation(origin = {-50, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
//replaceable package Medium = Modelica.Media.Air.SimpleAir;
// constrainedby Modelica.Media.Interfaces.PartialSimpleMedium;
// Modelica.Fluid.Sources.FixedBoundary source(replaceable package Medium = Modelica.Media.Air.SimpleAir, nPorts = 3, p = 101325, use_p = true) annotation( Placement(visible = true, transformation(origin = {-90, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
replaceable package Medium = Modelica.Media.Air.MoistAir;
Modelica.Fluid.Sources.FixedBoundary source(replaceable package Medium = Medium, nPorts = 3, p = 101325, use_p = true) annotation( Placement(visible = true, transformation(origin = {-90, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.FixedBoundary sink(replaceable package Medium = Medium, nPorts = 3, p = 101225) annotation(
Placement(visible = true, transformation(origin = {90, -50}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe1(replaceable package Medium = Medium, diameter(displayUnit = "mm") = 0.062, isCircular = true, length = 2) annotation(
Placement(visible = true, transformation(origin = {50, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Ramp pressure(duration = 10, height = 90, startTime = 10) annotation(
Placement(visible = true, transformation(origin = {10, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe2(replaceable package Medium = Medium, diameter(displayUnit = "mm") = 0.062, isCircular = true, length = 2) annotation(
Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe3(replaceable package Medium = Medium, diameter(displayUnit = "mm") = 0.062, isCircular = true, length = 2) annotation(
Placement(visible = true, transformation(origin = {50, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe4(replaceable package Medium = Medium, diameter(displayUnit = "mm") = 0.062, isCircular = true, length = 2) annotation(
Placement(visible = true, transformation(origin = {-50, -50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe5(replaceable package Medium = Medium, diameter(displayUnit = "mm") = 0.062, isCircular = true, length = 2) annotation(
Placement(visible = true, transformation(origin = {0, -50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe6(replaceable package Medium = Medium, diameter(displayUnit = "mm") = 0.062, isCircular = true, length = 2) annotation(
Placement(visible = true, transformation(origin = {50, -50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(pipe2.port_a, source.ports[1]) annotation(
Line(points = {{-10, -10}, {-72, -10}, {-72, 30}, {-80, 30}}, color = {0, 127, 255}));
connect(pipe4.port_a, source.ports[2]) annotation(
Line(points = {{-60, -50}, {-72, -50}, {-72, 30}, {-80, 30}}, color = {0, 127, 255}));
connect(pipe4.port_b, pipe5.port_a) annotation(
Line(points = {{-40, -50}, {-10, -50}}, color = {0, 127, 255}));
connect(pipe5.port_b, pipe6.port_a) annotation(
Line(points = {{10, -50}, {40, -50}}, color = {0, 127, 255}));
connect( sink.ports[1], pipe6.port_b) annotation(
Line(points = {{80, -50}, {60, -50}}, color = {0, 127, 255}));
connect(sink.ports[2], pipe3.port_b) annotation(
Line(points = {{80, -50}, {72, -50}, {72, -10}, {60, -10}}, color = {0, 127, 255}));
connect(pipe2.port_b, pipe3.port_a) annotation(
Line(points = {{10, -10}, {40, -10}}, color = {0, 127, 255}));
connect(pipe1.port_a, source.ports[3]) annotation(
Line(points = {{40, 30}, {-80, 30}}, color = {0, 127, 255}));
connect(sink.ports[3], pipe1.port_b) annotation(
Line(points = {{80, -50}, {72, -50}, {72, 30}, {60, 30}}, color = {0, 127, 255}));
annotation(
uses(Modelica(version = "4.0.0"), Buildings(version = "9.1.0")),
experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-06, Interval = 0.02));
end flowTest01;
Upvotes: 0
Views: 227
Reputation: 51
Finally got it
It uses the SpeedControlled_y from Buildings.Fluid.Movers.
here is an (almost) minimal way to do it, (adapted from Buildings.Fluid.Movers.Examples.ClosedLoop_y):
You can't do this through the GUI alone because you need to add the medium to each component. Its a bit cumbersome for large systems. I am still looking for a way to redefine the component to include the medium. If I find it I will add it here.
The fan curve part is:
per(pressure(V_flow = {0.0002, 0.015, 0.0224},
dp = {170, 100, 5})),
The whole code looks like this:
model FanTest01
package Medium = Buildings.Media.Air;
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = 0.0224 "Nominal mass flow rate";
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal_fan = 0.0128 "110m3/h Nominal mass flow rate for fan";
parameter Modelica.Units.SI.PressureDifference dp_nominal = 5 "Nominal pressure difference";
parameter Modelica.Units.SI.PressureDifference dp_nominal_fan = 117 "Nominal pressure difference for fan";
parameter Modelica.Units.SI.PressureDifference inlet_nominal = 20 "Inlet pressure difference";
parameter Modelica.Units.SI.Length steek = 0.44 "Horizontale steek tussen modulles";
parameter Modelica.Units.SI.Length diameter = 0.08 "Buis diameter";
// FAN
Buildings.Fluid.Movers.SpeedControlled_y fan(redeclare package Medium = Medium,
per(pressure(V_flow = {0.0002, 0.015, 0.0224},
dp = {170, 100, 5})),
energyDynamics = Modelica.Fluid.Types.Dynamics.FixedInitial) "Fan" annotation(
Placement(visible = true, transformation(origin = {70, 30}, extent = {{40, 40}, {60, 60}}, rotation = 0)));
Buildings.Fluid.Sources.Boundary_pT sou(redeclare package Medium = Medium, T = 293.15, nPorts = 2, p = 101300, use_p_in = false) annotation(
Placement(visible = true, transformation(origin = {82, 0}, extent = {{-82, 10}, {-62, 30}}, rotation = 0)));
Buildings.Fluid.FixedResistances.HydraulicDiameter duct01(redeclare package Medium = Medium,
dh = diameter, fac = 1, length = 0.44,
m_flow_nominal = m_flow_nominal) annotation(
Placement(visible = true, transformation(origin = {150, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Buildings.Fluid.FixedResistances.HydraulicDiameter duct02(redeclare package Medium = Medium,
dh = diameter, fac = 1, length = 0.44,
m_flow_nominal = m_flow_nominal) annotation(
Placement(visible = true, transformation(origin = {90, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Buildings.Fluid.FixedResistances.PressureDrop inlet(redeclare package Medium = Medium,
dp_nominal = inlet_nominal,
m_flow_nominal = m_flow_nominal) annotation(
Placement(visible = true, transformation(origin = {50, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
Modelica.Blocks.Sources.Ramp ramp(duration = 100, startTime = 10) annotation(
Placement(visible = true, transformation(origin = {90, 110}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(fan.port_b, duct01.port_a) annotation(
Line(points = {{130, 80}, {140, 80}}, color = {0, 127, 255}));
connect(duct01.port_b, sou.ports[1]) annotation(
Line(points = {{160, 80}, {170, 80}, {170, 20}, {20, 20}}, color = {0, 127, 255}));
connect(ramp.y, fan.y) annotation(
Line(points = {{101, 110}, {120, 110}, {120, 92}}, color = {0, 0, 127}));
connect(fan.port_a, duct02.port_b) annotation(
Line(points = {{110, 80}, {100, 80}}, color = {0, 127, 255}));
connect(inlet.port_a, sou.ports[2]) annotation(
Line(points = {{50, 40}, {50, 20}, {20, 20}}, color = {0, 127, 255}));
connect(inlet.port_b, duct02.port_a) annotation(
Line(points = {{50, 60}, {50, 80}, {80, 80}}, color = {0, 127, 255}));
annotation(
Diagram(coordinateSystem(preserveAspectRatio = true, extent = {{-200, 160}, {200, -240}})),
Documentation(info = "<html>
<p>
Adapted from 'ClosedLoop_y' example.
</p>
</html>"),
__Dymola_Commands(file = "modelica://Buildings/Resources/Scripts/Dymola/Fluid/Movers/Examples/ClosedLoop_y.mos" "Simulate and plot"),
experiment(StopTime = 200, Tolerance = 1e-06, StartTime = 0, Interval = 1),
uses(Buildings(version = "9.1.0"), Modelica(version = "4.0.0")),
Icon(coordinateSystem(extent = {{-200, -260}, {200, 160}}, preserveAspectRatio = true)),
version = "");
end FanTest01;
I still have a question about how to match the fan curve, but I'll put that in a new question.
Upvotes: 0