Ticket #5686: pipe.mo

File pipe.mo, 3.7 KB (added by hauke.hirsch@…, 5 years ago)

modelica model of the fmu

Line 
1model pipe
2replaceable package Medium = Modelica.Media.Water.StandardWaterOnePhase
3 constrainedby Modelica.Media.Interfaces.PartialMedium;
4
5 input Modelica.Fluid.Sources.MassFlowSource_T Input(redeclare package Medium = Medium, nPorts = 1, use_T_in = true, use_m_flow_in = true) annotation(
6 Placement(visible = true, transformation(origin = {-52, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
7 output Modelica.Fluid.Sources.FixedBoundary Output(redeclare package Medium = Medium, nPorts = 1) annotation(
8 Placement(visible = true, transformation(origin = {62, 2}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
9 Modelica.Fluid.Pipes.DynamicPipe dynamicPipe(redeclare package Medium = Medium, diameter = 0.025, length = 100, nNodes = 3, use_HeatTransfer = true) annotation(
10 Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
11 Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow pipeHeatFlow annotation(
12 Placement(visible = true, transformation(origin = {-40, 66}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
13 Modelica.Blocks.Sources.Sine sine1(amplitude = 5, freqHz = 0.01, offset = 293) annotation(
14 Placement(visible = true, transformation(origin = {-86, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
15 Modelica.Blocks.Sources.Constant const(k = 0.2) annotation(
16 Placement(visible = true, transformation(origin = {-88, 38}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
17 Modelica.Blocks.Interfaces.RealOutput Tpipe_in annotation(
18 Placement(visible = true, transformation(origin = {64, -36}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {64, -36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
19 Modelica.Blocks.Interfaces.RealOutput Tpipe_out annotation(
20 Placement(visible = true, transformation(origin = {66, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {66, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
21 Modelica.Fluid.Sensors.TemperatureTwoPort temperature(redeclare package Medium = Medium) annotation(
22 Placement(visible = true, transformation(origin = {30, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
23 Modelica.Blocks.Interfaces.RealInput Qpipe_in annotation(
24 Placement(visible = true, transformation(origin = {-94, 66}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-94, 66}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
25equation
26 connect(Qpipe_in, pipeHeatFlow.Q_flow) annotation(
27 Line(points = {{-94, 66}, {-52, 66}, {-52, 66}, {-50, 66}}, color = {0, 0, 127}));
28 connect(temperature.T, Tpipe_out) annotation(
29 Line(points = {{30, 12}, {30, 12}, {30, 40}, {66, 40}, {66, 40}}, color = {0, 0, 127}));
30 connect(temperature.port_b, Output.ports[1]) annotation(
31 Line(points = {{40, 0}, {52, 0}, {52, 2}, {52, 2}}, color = {0, 127, 255}));
32 connect(dynamicPipe.port_b, temperature.port_a) annotation(
33 Line(points = {{10, 0}, {20, 0}, {20, 0}, {20, 0}}, color = {0, 127, 255}));
34 connect(pipeHeatFlow.port, dynamicPipe.heatPorts[1]) annotation(
35 Line(points = {{-30, 66}, {0, 66}, {0, 4}}, color = {191, 0, 0}));
36 connect(const.y, Input.m_flow_in) annotation(
37 Line(points = {{-77, 38}, {-68, 38}, {-68, 8}, {-62, 8}}, color = {0, 0, 127}));
38 connect(sine1.y, Tpipe_in) annotation(
39 Line(points = {{-74, 4}, {-72, 4}, {-72, -36}, {64, -36}, {64, -36}}, color = {0, 0, 127}));
40 connect(sine1.y, Input.T_in) annotation(
41 Line(points = {{-75, 4}, {-64, 4}}, color = {0, 0, 127}));
42 connect(Input.ports[1], dynamicPipe.port_a) annotation(
43 Line(points = {{-42, 0}, {-10, 0}}, color = {0, 127, 255}));
44 annotation(
45 uses(Modelica(version = "3.2.3")));
46
47end pipe;