You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在OpenModelica风管系统中添加带特性曲线的风机

在OpenModelica Fluid库中搭建带风机的风管网络模型问题

我正尝试在OpenModelica的Fluid库中搭建空气输送风管网络模型。测试了Fluid.Machines中的Pump、ControlledPump和PrescribedPump组件,阅读描述后仍无法正常运行。

我希望在模型中输入类似小型轴流风机的PQ特性曲线,无需高精度,仅用于早期设计研究,测试含一台或多台风机的不同布局,几个拟合点即可。修改示例后仍无头绪,不确定该选用哪种组件及配置方法。

目前我通过创建压力不同的FixedBoundary源和汇并连接StaticPipe实现了风管流量,模型可正常仿真,但不知如何添加合适的风机或泵组件。

模型代码如下:

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;

解决方案

1. 组件选择:用Modelica.Fluid.Machines.Pump自定义PQ曲线

对于早期设计的低精度需求,Pump组件最适合——它允许直接输入PQ特性曲线的离散点,无需复杂控制逻辑。ControlledPump和PrescribedPump更适合闭环控制或指定流量/功率的场景,不符合你的需求。

2. PQ曲线配置步骤

  • 打开Pump组件的参数面板,找到characteristic参数组
  • 设置useCharacteristicCurve = true
  • 在flowRates和pressures数组中输入你的风机PQ点(单位:流量用m³/s,压力用Pa)
    示例:如果风机在0流量时提供100Pa压力,0.005m³/s时提供80Pa,0.01m³/s时提供50Pa,参数设置为:
    flowRates = {0, 0.005, 0.01};
    pressures = {100, 80, 50};
    
  • 确保Medium参数和风管模型一致(此处为Modelica.Media.Air.MoistAir)

3. 替换原模型的压力驱动方式

原模型用FixedBoundary的压力差产生流量,可按以下方式修改:

  • 保留一个FixedBoundary作为环境压力源(比如p=101325Pa),在风管支路中插入Pump组件
  • 以pipe1支路为例,修改步骤:
    1. 删除sink.ports[3]和pipe1.port_b的连接
    2. 添加Pump组件并配置PQ曲线
    3. 连接pipe1.port_b到Pump入口,Pump出口到sink.ports[3]

4. 完整修改后的模型代码示例

model flowTest01_withFan

  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.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 = 101325) 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.Fluid.Machines.Pump fan1(replaceable package Medium = Medium,
    characteristic(useCharacteristicCurve = true,
      flowRates = {0, 0.005, 0.01},
      pressures = {100, 80, 50})) annotation(
    Placement(origin = {70, 30}, extent = {{-10, -10}, {10, 10}}));
  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)));
  // 支路添加第二台风机示例
  Modelica.Fluid.Machines.Pump fan2(replaceable package Medium = Medium,
    characteristic(useCharacteristicCurve = true,
      flowRates = {0, 0.004, 0.008},
      pressures = {90, 70, 40})) annotation(
    Placement(origin = {-30, -50}, extent = {{-10, -10}, {10, 10}}));
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, fan2.port_a) annotation(
    Line(points = {{-40, -50}, {-40, -50}}, color = {0, 127, 255}));
  connect(fan2.port_b, pipe5.port_a) annotation(
    Line(points = {{-20, -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(pipe1.port_b, fan1.port_a) annotation(
    Line(points = {{60, 30}, {60, 30}}, color = {0, 127, 255}));
  connect(fan1.port_b, sink.ports[3]) annotation(
    Line(points = {{80, 30}, {80, -50}}, color = {0, 127, 255}));
  annotation(
    uses(Modelica(version = "4.0.0"), Buildings(version = "9.1.0")),
    experiment(StartTime = 0, StopTime = 10, Toler
相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 12:27:47