0

注意:这个问题引用了位于 ThermoPower.Examples.RankineCycle.Models.PrescribedSpeedPump 的 PrescribedSpeedPump.mo

我正在尝试简单的泵模型,因为我构建的所有包含该泵的模型总是产生相同的错误消息:

[1] 16:02:01 转换错误 [ThermoPower.PowerPlants: 2071:95-2071:108]:在 ThermoPower.PowerPlants.HRSG.Components 范围内找不到变量 q_nom。

[2] 16:02:01 转换错误 [ThermoPower.PowerPlants: 2076:84-2076:132]:在范围内找到循环相关的常量或参数:{q_nom}、{head_nom}(使用 -d=ignoreCycles 忽略)。

在检查这个 PrescribedSpeedPump 后,它由两个类组成:“FluidMedium”和“flowCharacteristic”。导致错误的是函数 - “FlowCharacteristic”。

为什么我感到困惑:错误表明它在 ThermoPower.PowerPlants.HRSG.Components 的路径中找不到变量 q_nom。好吧,前面提到过,我说它位于 ThermoPower 库的示例包中。

我对这种情况感到困惑的另一个原因是,我能够手动输入 q_nom 和 head_nom 的参数值。他们都被赋予了 {1,2,3} 的虚拟值。尽管如此,变量“找不到”。

最后,我尝试自己手动编辑“flowCharacteristic”函数,然后尝试检查我的模型。仍然出现相同的错误。我现在真的不知道如何解决这个错误,并尝试了我能想到的。

如果您有任何见解或建议,请随时在下面发表评论!感谢您阅读本文,感谢您花时间和精力帮助社区中的其他人。下面我已将代码复制到我的泵模型中。

代码更新:

model Pump_Verified


function flowCharacteristic =
ThermoPower.Functions.PumpCharacteristics.quadraticFlow (
q_nom = q_nom, head_nom = head_nom);

ThermoPower.PowerPlants.HRSG.Components.PrescribedSpeedPump
prescribedSpeedPump1(
redeclare package WaterMedium = ThermoPower.Water.StandardWater,
Np0 = 1,
V = 20,
head_nom = {1, 2, 3},
hstart = 451024,
n0 = 1200,
nominalFlow = 142.512,
nominalInletPressure=132000,
nominalOutletPressure=8581000,
q_nom = {1, 2, 3},
rho0=1000)
          annotation (
Placement(visible = true, transformation(origin = {2, 0}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));

ThermoPower.Examples.RankineCycle.Models.PrescribedPressureCondenser
Condenser(
Vtot = 50,
p = 132000)  annotation (
Placement(visible = true, transformation(origin = {-50, 40}, extent = 
{{-10,
-10}, {10, 10}}, rotation = 0)));

ThermoPower.PowerPlants.SteamTurbineGroup.Components.StateReader_water
stateReader_water1 annotation (
Placement(visible = true, transformation(origin = {-50, 70}, extent = 
{{-10,
-10}, {10, 10}}, rotation = -90)));

ThermoPower.PowerPlants.SteamTurbineGroup.Components.StateReader_water
stateReader_water2 annotation (
Placement(visible = true, transformation(origin = {-50, 10}, extent = 
{{-10,
-10}, {10, 10}}, rotation = -90)));

ThermoPower.Water.SourceMassFlow SourceSteamFlow(
T = 380.561 - 273,
h = 931235,
p0 = 1.32e5,
w0 = 142.512)  annotation (
Placement(visible = true, transformation(origin = {-72, 84}, extent = 
{{-10,
-10}, {10, 10}}, rotation = 0)));

ThermoPower.Water.SinkMassFlow SinkWaterFlow annotation (
Placement(visible = true, transformation(origin = {52, 0}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));

inner ThermoPower.System system annotation (
Placement(visible = true, transformation(origin = {90, 88}, extent = 
{{-10,
-10}, {10, 10}}, rotation = 0)));

ThermoPower.Water.SensP sensP_Inlet annotation(
Placement(visible = true, transformation(origin = {-32, 4}, extent = 
{{-10, -10}, {10, 10}}, rotation = 0)));

ThermoPower.Water.SensP sensP_Outlet annotation(
Placement(visible = true, transformation(origin = {26, 4}, extent = {{-10, 
-10}, {10, 10}}, rotation = 0)));

Modelica.Blocks.Sources.Constant const(k = 1200)  annotation(
Placement(visible = true, transformation(origin = {-10, 66}, extent = 
{{-10, -10}, {10, 10}}, rotation = 0)));

equation
connect(const.y, prescribedSpeedPump1.pumpSpeed_rpm) annotation(
Line(points = {{2, 66}, {10, 66}, {10, 30}, {-18, 30}, {-18, 6}, {-6, 6}, 
{-6, 6}}, color = {0, 0, 127}));
connect(sensP_Outlet.flange, SinkWaterFlow.flange) annotation(
Line(points = {{26, 0}, {42, 0}, {42, 0}, {42, 0}}, color = {0, 0, 255}));
connect(prescribedSpeedPump1.outlet, sensP_Outlet.flange) annotation(
Line(points = {{12, 0}, {26, 0}, {26, 0}, {26, 0}}, color = {0, 0, 255}));
connect(sensP_Inlet.flange, prescribedSpeedPump1.inlet) annotation(
Line(points = {{-32, 0}, {-8, 0}, {-8, 0}, {-8, 0}}, color = {0, 0, 
255}));
connect(stateReader_water2.outlet, sensP_Inlet.flange) annotation(
Line(points = {{-50, 4}, {-50, 4}, {-50, 0}, {-32, 0}, {-32, 0}}, color = 
{0, 0, 255}));
connect(Condenser.waterOut, stateReader_water2.inlet) annotation(
Line(points = {{-50, 30}, {-50, 16}}, color = {0, 0, 255}));
connect(stateReader_water1.outlet, Condenser.steamIn) annotation(
Line(points = {{-50, 64}, {-50, 50}}, color = {0, 0, 255}));
connect(SourceSteamFlow.flange, stateReader_water1.inlet) annotation(
Line(points = {{-62, 84}, {-50, 84}, {-50, 76}, {-50, 76}, {-50, 76}}, 
color = {0, 0, 255}));
annotation (
uses(ThermoPower(version = "3.1"), Modelica(version="3.2.2")));

end Pump_Verified;
4

1 回答 1

1

您正在使用 ThermoPower.PowerPlants.HRSG.Components.PrescribedSpeedPump,但您似乎想要修改它,特别是:

  • 该模型中已经存在函数 flowCharacteristic - 但不可替换,因此您无法更改它,并且无论如何您都不能在重新声明中使用模型中的 q_nom。但是因为它已经是二次的,所以没有必要改变它。
  • 没有为此组件指定介质(假设我使用了正确的 ThermoPower 版本)。
  • 规定的速度泵有一个未连接的输入。

如果您只想使用它:

  • 去掉函数 flowCharacteristic
  • 重新声明介质
  • 将一些信号连接到泵

以下至少在 Dymola 中有效:

model Pump_Check

function flowCharacteristic =
ThermoPower.Functions.PumpCharacteristics.quadraticFlow (
q_nom = q_nom, head_nom = head_nom);

ThermoPower.PowerPlants.HRSG.Components.PrescribedSpeedPump
prescribedSpeedPump1(
    redeclare package WaterMedium = ThermoPower.Water.StandardWater,
Np0 = 1,
V = 20,
head_nom = {1, 2, 3},
hstart = 451024,
n0 = 1200,
nominalFlow = 142.512,
    nominalInletPressure=132000,
    nominalOutletPressure=8581000,
q_nom = {1, 2, 3},
    rho0=1000)
              annotation (
Placement(visible = true, transformation(origin = {2, 0}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));

ThermoPower.Examples.RankineCycle.Models.PrescribedPressureCondenser
Condenser(
Vtot = 50,
p = 132000)  annotation (
Placement(visible = true, transformation(origin = {-50, 40}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));

ThermoPower.PowerPlants.SteamTurbineGroup.Components.StateReader_water
stateReader_water1 annotation (
Placement(visible = true, transformation(origin = {-50, 70}, extent = {{-10,
-10}, {10, 10}}, rotation = -90)));

ThermoPower.PowerPlants.SteamTurbineGroup.Components.StateReader_water
stateReader_water2 annotation (
Placement(visible = true, transformation(origin = {-50, 10}, extent = {{-10,
-10}, {10, 10}}, rotation = -90)));

ThermoPower.Water.SourceMassFlow SourceSteamFlow(
T = 380.561 - 273,
h = 931235,
p0 = 1.32e5,
w0 = 142.512)  annotation (
Placement(visible = true, transformation(origin = {-72, 84}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));

ThermoPower.Water.SinkMassFlow SinkWaterFlow annotation (
Placement(visible = true, transformation(origin = {52, 0}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
inner ThermoPower.System system annotation (
Placement(visible = true, transformation(origin = {90, 88}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Interfaces.RealInput pumpSpeed_rpm1
    annotation (Placement(transformation(extent={{-46,66},{-6,106}})));
equation 
connect(prescribedSpeedPump1.outlet, SinkWaterFlow.flange) annotation (
Line(points = {{12, 0}, {42, 0}, {42, 0}, {42, 0}}, color = {0, 0, 255}));
connect(stateReader_water2.outlet, prescribedSpeedPump1.inlet) annotation (
Line(points = {{-50, 4}, {-50, 4}, {-50, 0}, {-8, 0}, {-8, 0}}, color = {0,
0, 255}));
connect(Condenser.waterOut, stateReader_water2.inlet) annotation (
Line(points={{-50,30},{-50,16}},                            color = {0, 0,
255}));
connect(stateReader_water1.outlet, Condenser.steamIn) annotation (
Line(points={{-50,64},{-50,50}},                            color = {0, 0,
255}));
connect(SourceSteamFlow.flange, stateReader_water1.inlet) annotation (
Line(points = {{-62, 84}, {-50, 84}, {-50, 76}, {-50, 76}, {-50, 76}}, color=
  {0, 0, 255}));

  connect(prescribedSpeedPump1.pumpSpeed_rpm, pumpSpeed_rpm1) annotation (Line(
        points={{-5.2,6},{-16,6},{-16,86},{-26,86}}, color={0,0,127}));
annotation (
uses(ThermoPower(version = "3.1"), Modelica(version="3.2.2")));
end Pump_Check;
于 2019-03-06T13:55:37.473 回答