1+ within FluidSystemComponents.Sensor.Examples;
2+
3+ model StaticStatesTwoPort01_ex01
4+ extends Modelica.Icons.Example;
5+ //-----
6+ package fluid1 = Modelica.Media.Air.DryAirNasa;
7+ //package fluid1 = FluidSystemComponents.Media.Mixture_N2O2;
8+ //-----
9+ Modelica.Fluid.Sources.Boundary_pT boundary(redeclare package Medium = fluid1, T = 500 , nPorts = 1 , p = 5 * 101.325 * 1000 , use_T_in = true , use_p_in = true ) annotation(
10+ Placement(visible = true, transformation(origin = {-50, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
11+ inner Modelica.Fluid.System system annotation(
12+ Placement(visible = true, transformation(origin = {-90, 90}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
13+ Modelica.Blocks.Sources.Ramp ramp_p1(duration = 10 , height = 0 , offset = 2 * 101.325 * 1000 , startTime = 10 ) annotation(
14+ Placement(visible = true, transformation(origin = {-90, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
15+ Modelica.Blocks.Sources.Ramp ramp_T1(duration = 10 , height = 0 , offset = 500 , startTime = 30 ) annotation(
16+ Placement(visible = true, transformation(origin = {-90, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
17+ CommonAnyFluid.Components.VariableZetaOrifice00 Orifice(redeclare package Medium = fluid1) annotation(
18+ Placement(visible = true, transformation(origin = {-10, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
19+ Modelica.Blocks.Sources.Ramp ramp_zeta(duration = 10 , height = 1 , offset = 1 , startTime = 10 ) annotation(
20+ Placement(visible = true, transformation(origin = {-30, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
21+ Modelica.Fluid.Sources.MassFlowSource_T boundary1(redeclare package Medium = fluid1, m_flow = - 0.01 , nPorts = 1 , use_m_flow_in = true ) annotation(
22+ Placement(transformation(origin = {60, 20}, extent = {{10, -10}, {-10, 10}})));
23+ Modelica.Blocks.Sources.Ramp ramp_m_flow(duration = 10 , height = - 0.01 , offset = - 0.01 , startTime = 50 ) annotation(
24+ Placement(transformation(origin = {90, 28}, extent = {{10, -10}, {-10, 10}})));
25+ FluidSystemComponents.Sensor.StaticStatesTwoPort01 StaticStates(redeclare package Medium = fluid1) annotation(
26+ Placement(transformation(origin = {20, 20}, extent = {{-10, -10}, {10, 10}})));
27+ equation
28+ connect (ramp_zeta.y, Orifice.u_zeta) annotation(
29+ Line(points = {{-18, -10}, {-14, -10}, {-14, 11}}, color = {0, 0, 127}));
30+ connect (boundary.ports[1 ], Orifice.port_1) annotation(
31+ Line(points = {{-40, 20}, {-20, 20}}, color = {0, 127, 255}));
32+ connect (ramp_T1.y, boundary.T_in) annotation(
33+ Line(points = {{-78, 20}, {-70, 20}, {-70, 24}, {-62, 24}, {-62, 24}}, color = {0, 0, 127}));
34+ connect (ramp_p1.y, boundary.p_in) annotation(
35+ Line(points = {{-78, 50}, {-72, 50}, {-72, 28}, {-62, 28}, {-62, 28}}, color = {0, 0, 127}));
36+ connect (boundary1.m_flow_in, ramp_m_flow.y) annotation(
37+ Line(points = {{70, 28}, {79, 28}}, color = {0, 0, 127}));
38+ connect (StaticStates.port_2, boundary1.ports[1 ]) annotation(
39+ Line(points = {{30, 20}, {50, 20}}, color = {0, 127, 255}));
40+ connect (Orifice.port_2, StaticStates.port_1) annotation(
41+ Line(points = {{0, 20}, {10, 20}}, color = {0, 127, 255}));
42+ annotation(
43+ experiment(StartTime = 0, StopTime = 80, Tolerance = 1e-06, Interval = 0.1),
44+ __OpenModelica_simulationFlags(lv = "LOG_STATS" , outputFormat = "mat" , s = "dassl" ));
45+
46+
47+ end StaticStatesTwoPort01_ex01;
0 commit comments