首页 > 解决方案 > 串行双调节

问题描述

我是 Modelica 和 OpenModelica 的新手,我正在尝试自己学习这种语言。

我目前正在研究一个模型,其目标是验证串行双重监管的原则:

我放置了一个热交换器。在热交换器的左侧,安装了两个阀门来调节热流(最大 87 000 W)。在热交换器的右侧,调节三通分流阀以获得等于 80 °C 的最终温度 (T_final)。该调节是PID调节。泵产生恒定的质量流量 (1 kg/s)。

由于组件“temperature_input”,我施加了不同的温度。目标是获得 80 °C 的最终温度,无论输入温度值如何(最大 87 000 W)。

对于以下型号,阀门不受调节。另外,我想确保最大热流为 87 000 W(也许使用“FixedHeatFlow”组件?)。而且我不知道问题是否定义错误,或者 PID 控制器的值是否错误。

有人能帮助我吗?

非常感谢您的回答

这是一个示意图来说明我的问题:

在此处输入图像描述

该模型:

model SousStation84

replaceable package Medium = Modelica.Media.Water.StandardWaterOnePhase;
replaceable package Medium1 = AixLib.Media.Water "Medium model";
replaceable package Medium2 = AixLib.Media.Water "Medium model";

Modelica.Fluid.Sensors.MassFlowRate m_in_primary(
  redeclare package Medium = Medium)
  annotation(
      Placement(visible = true, transformation(origin = {-150, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Fluid.Sensors.MassFlowRate m_out_primary(
  redeclare package Medium = Medium)
  annotation(
      Placement(visible = true, transformation(origin = {-150, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

AixLib.Fluid.Sensors.TemperatureTwoPort T_in_primary(
  m_flow_nominal = 1,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {-104, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

AixLib.Fluid.Sensors.TemperatureTwoPort T_out_primary(
  m_flow_nominal = 1,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {-70, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

Modelica.Fluid.Sources.FixedBoundary source(
  
redeclare package Medium = Medium,nPorts = 1, p = 100000, use_p = true)
  annotation(
    Placement(visible = true, transformation(extent = {{-340, -70}, {-320, -50}}, rotation = 0)));

AixLib.Fluid.Sensors.TemperatureTwoPort T2(
  m_flow_nominal = 1,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {-280, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

Modelica.Fluid.Sensors.MassFlowRate m2(
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {-242, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

Modelica.Fluid.Valves.ValveIncompressible Valve_1(
  Kv = 16,
  dp_nominal = 60000,
  m_flow_nominal = 1.8,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {-198, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

AixLib.Fluid.Sensors.TemperatureTwoPort T1(
  m_flow_nominal = 1,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {-228, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Fluid.Valves.ValveIncompressible Valve_2(
  Kv = 16,
  dp_nominal = 60000,
  m_flow_nominal = 1,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {-192, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

Modelica.Blocks.Continuous.LimPID PID_1(
  Td = 0,
  Ti = 300,
  controllerType = Modelica.Blocks.Types.SimpleController.PID,
  k = 3,
  limitsAtInit = true)
  annotation(
    Placement(visible = true, transformation(origin = {-224, 98}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Blocks.Sources.Constant constant2(
  k = 353)
  annotation(
    Placement(visible = true, transformation(origin = {-290, 98}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU hex(
  redeclare package Medium1 = Medium1,
  redeclare package Medium2 = Medium2,
  Q_flow_nominal = 87000,
  T_a1_nominal = 353.15,
  T_a2_nominal = 333.15,
  configuration = Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow,
  dp1_nominal = 120000,
  dp2_nominal = 100000,
  m1_flow_nominal = 8,
  m2_flow_nominal = 6,
  use_Q_flow_nominal = true)
  annotation(
    Placement(visible = true, transformation(origin = {-25, -17}, extent = {{-25, 25}, {25, -25}}, rotation = -90)));

AixLib.Fluid.Sensors.TemperatureTwoPort T_final(
  m_flow_nominal = 1.8,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(extent = {{152, 30}, {172, 50}}, rotation = 0)));

AixLib.Fluid.Sensors.TemperatureTwoPort T_V3V(
  m_flow_nominal = 1,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {126, -36}, extent = {{-10, 10}, {10, -10}}, rotation = -90)));

Modelica.Fluid.Sources.Boundary_pT temperature_input(
  redeclare package Medium = Medium,
  T = 333,nPorts = 1,
  use_T_in = false)
  annotation(
    Placement(visible = true, transformation(origin = {270, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

AixLib.Fluid.Sensors.TemperatureTwoPort T_input(
  m_flow_nominal = 1,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {224, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

Modelica.Blocks.Continuous.LimPID PID_2(
  Td = 0,
  Ti = 300,
  controllerType = Modelica.Blocks.Types.SimpleController.PID,
  k = 3,
  limitsAtInit = true)
  annotation(
    Placement(visible = true, transformation(origin = {62, 104}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Fluid.Sensors.MassFlowRate m_input(
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {186, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

Modelica.Fluid.Machines.ControlledPump pump(
  N_nominal = 1500,
  m_flow_nominal = 1,
  p_a_nominal = 110000,
  p_b_nominal = 130000,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {146, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

Modelica.Fluid.Sources.FixedBoundary fixedBoundary(
  nPorts = 1,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {272, 40}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

AixLib.Fluid.Sensors.TemperatureTwoPort T_out_secondary(
  m_flow_nominal = 1.8,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(extent = {{20, 30}, {40, 50}}, rotation = 0)));

Modelica.Fluid.Sensors.MassFlowRate m_V3V(
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {126, -4}, extent = {{10, -10}, {-10, 10}}, rotation = 90)));

AixLib.Fluid.Actuators.Valves.ThreeWayLinear threeWayLinear(
  dpValve_nominal = 60000,
  m_flow_nominal = 1.8,
  use_inputFilter = false,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {128, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Fluid.Sensors.MassFlowRate m_out_secondary(
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {88, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Fluid.Sensors.MassFlowRate m_in_secondary(
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {82, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

Modelica.Blocks.Sources.Constant constant1(
  k = 353)
  annotation(
    Placement(visible = true, transformation(origin = {-4, 108}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Fluid.Sensors.MassFlowRate m_final(
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {210, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

AixLib.Fluid.Sensors.TemperatureTwoPort T_in_secondary(
  m_flow_nominal = 1,
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {30, -76}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

Modelica.Fluid.Sensors.MassFlowRate m1(
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {-284, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Fluid.Sources.FixedBoundary fixedBoundary1(
  redeclare package Medium = Medium,
  nPorts = 1,
  p = 200000,
  use_p = true)
  annotation(
    Placement(visible = true, transformation(extent = {{-348, 26}, {-328, 46}}, rotation = 0)));

Modelica.Fluid.Sensors.SpecificEnthalpyTwoPort specificEnthalpy(
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {-64, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Fluid.Sensors.SpecificEnthalpyTwoPort specificEnthalpy1(
  redeclare package Medium = Medium)
  annotation(
    Placement(visible = true, transformation(origin = {-112, -60}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));

equation
  connect(m_in_primary.port_b, T_in_primary.port_a) annotation(
    Line(points = {{-140, 36}, {-114, 36}}, color = {0, 127, 255}));
  connect(m2.port_a, Valve_2.port_b) annotation(
    Line(points = {{-232, -60}, {-202, -60}}, color = {0, 127, 255}));
  connect(source.ports[1], T2.port_b) annotation(
    Line(points = {{-320, -60}, {-290, -60}}, color = {0, 127, 255}));
  connect(T1.port_b, Valve_1.port_a) annotation(
    Line(points = {{-234, 36}, {-208, 36}}, color = {0, 127, 255}));
  connect(T2.port_a, m2.port_b) annotation(
    Line(points = {{-270, -60}, {-252, -60}}, color = {0, 127, 255}));
  connect(Valve_1.port_b, m_in_primary.port_a) annotation(
    Line(points = {{-188, 36}, {-160, 36}}, color = {0, 127, 255}));
  connect(Valve_2.port_a, m_out_primary.port_b) annotation(
    Line(points = {{-182, -60}, {-160, -60}}, color = {0, 127, 255}));
  connect(constant2.y, PID_1.u_s) annotation(
    Line(points = {{-279, 98}, {-236, 98}}, color = {0, 0, 127}));
  connect(PID_1.y, Valve_1.opening) annotation(
    Line(points = {{-213, 98}, {-198, 98}, {-198, 44}}, color = {0, 0, 127}));
  connect(PID_1.y, Valve_2.opening) annotation(
    Line(points = {{-213, 98}, {-192, 98}, {-192, -52}}, color = {0, 0, 127}));
  connect(hex.port_b1, T_out_primary.port_a) annotation(
    Line(points = {{-40, -42}, {-40, -60}, {-60, -60}}, color = {0, 127, 255}));
  connect(T_input.port_a, temperature_input.ports[1]) annotation(
    Line(points = {{234, -76}, {260, -76}}, color = {0, 127, 255}));
  connect(threeWayLinear.port_2, T_final.port_a) annotation(
    Line(points = {{138, 40}, {152, 40}}, color = {0, 127, 255}));
  connect(m_input.port_a, T_input.port_b) annotation(
    Line(points = {{196, -76}, {214, -76}}, color = {0, 127, 255}));
  connect(m_V3V.port_b, T_V3V.port_a) annotation(
    Line(points = {{126, -14}, {126, -26}}, color = {0, 127, 255}));
  connect(constant1.y, PID_2.u_s) annotation(
    Line(points = {{7, 108}, {30, 108}, {30, 104}, {50, 104}}, color = {0, 0, 127}));
  connect(m_out_secondary.port_b, threeWayLinear.port_1) annotation(
    Line(points = {{98, 40}, {118, 40}}, color = {0, 127, 255}));
  connect(T_final.T, PID_2.u_m) annotation(
    Line(points = {{162, 51}, {162, 80}, {62, 80}, {62, 92}}, color = {0, 0, 127}));
  connect(pump.port_a, m_input.port_b) annotation(
    Line(points = {{156, -76}, {176, -76}}, color = {0, 127, 255}));
  connect(T_V3V.port_b, pump.port_a) annotation(
    Line(points = {{126, -46}, {126, -58}, {156, -58}, {156, -76}}, color = {0, 127, 255}));
  connect(T_in_secondary.port_a, m_in_secondary.port_b) annotation(
    Line(points = {{40, -76}, {72, -76}}, color = {0, 127, 255}));
  connect(m_final.port_b, fixedBoundary.ports[1]) annotation(
    Line(points = {{220, 40}, {262, 40}}, color = {0, 127, 255}));
  connect(PID_2.y, threeWayLinear.y) annotation(
    Line(points = {{73, 104}, {128, 104}, {128, 52}}, color = {0, 0, 127}));
  connect(T_out_secondary.port_b, m_out_secondary.port_a) annotation(
    Line(points = {{40, 40}, {78, 40}}, color = {0, 127, 255}));
  connect(m_in_secondary.port_a, pump.port_b) annotation(
    Line(points = {{92, -76}, {136, -76}}, color = {0, 127, 255}));
  connect(m_V3V.port_a, threeWayLinear.port_3) annotation(
    Line(points = {{126, 6}, {126, 21}, {128, 21}, {128, 30}}, color = {0, 127, 255}));
  connect(T_final.port_b, m_final.port_a) annotation(
    Line(points = {{172, 40}, {200, 40}}, color = {0, 127, 255}));
  connect(hex.port_a2, T_in_secondary.port_b) annotation(
    Line(points = {{-10, -42}, {-10, -42}, {-10, -76}, {20, -76}, {20, -76}}, color = {0, 127, 255}));
  connect(hex.port_b2, T_out_secondary.port_a) annotation(
    Line(points = {{-10, 8}, {-10, 8}, {-10, 40}, {20, 40}, {20, 40}}, color = {0, 127, 255}));
  connect(T_final.T, PID_1.u_m) annotation(
    Line(points = {{162, 52}, {65.5, 52}, {65.5, 66}, {-224, 66}, {-224, 86}}, color = {0, 0, 127}));
  connect(m1.port_b, T1.port_a) annotation(
    Line(points = {{-274, 36}, {-238, 36}}, color = {0, 127, 255}));
  connect(fixedBoundary1.ports[1], m1.port_a) annotation(
    Line(points = {{-328, 36}, {-294, 36}}, color = {0, 127, 255}));
  connect(m_out_primary.port_a, specificEnthalpy1.port_b) annotation(
    Line(points = {{-140, -60}, {-124, -60}, {-124, -60}, {-122, -60}}, color = {0, 127, 255}));
  connect(specificEnthalpy1.port_a, T_out_primary.port_b) annotation(
    Line(points = {{-102, -60}, {-80, -60}, {-80, -60}, {-80, -60}}, color = {0, 127, 255}));
  connect(T_in_primary.port_b, specificEnthalpy.port_a) annotation(
    Line(points = {{-94, 36}, {-74, 36}, {-74, 36}, {-74, 36}}, color = {0, 127, 255}));
  connect(specificEnthalpy.port_b, hex.port_a1) annotation(
    Line(points = {{-54, 36}, {-40, 36}, {-40, 8}, {-40, 8}}, color = {0, 127, 255}));
end SousStation84;

标签: modelicaopenmodelica

解决方案


推荐阅读