首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么q_nom & head_nom总是给由ThermoPower库构建的模型提供问题?

为什么q_nom & head_nom总是给由ThermoPower库构建的模型提供问题?
EN

Stack Overflow用户
提问于 2019-02-20 18:10:00
回答 1查看 302关注 0票数 1

我已经在ThermoPower OpenModelica库中工作了一段时间,现在我试图通过首先建模Brayton和Rankine循环来构建一个组合的电源循环。

每当我尝试使用一个泵时,我总是会收到这样的错误:

代码语言:javascript
复制
[1] 10:31:00 Translation Error
[ThermoPower.Examples: 2523:70-2523:81]: Variable q_nom not found in scope ThermoPower.Examples.RankineCycle.Models.

[2] 10:31:00 Translation Error
[ThermoPower.Examples: 2531:21-2531:69]: Cyclically dependent constants or parameters found in scope : {q_nom}, {head_nom} (ignore with -d=ignoreCycles).

任何选择的泵,都会为我的模型声明这些错误。我尝试过许多不同类型的解决方案,但都没有成功。

  1. 我尝试使用向量格式(即:q_nom = {1,1,1} )声明泵的组件参数的值。在尝试模拟时会出现相同的错误。
  2. 我已经尝试直接单击错误,但只被重新定向到ThermoPower.PowerPlants。这里我的目标是一行代码: 函数flowCharacteristic =flowCharacteristic (q_nom= q_nom,head_nom=head_nom);

在这里,我尝试手动输入q_nom & head_nom的值,但没有成功。我还尝试在我的模型顶部复制上面的代码行,试图“重新声明”函数flowCharacteristic。这只会导致错误地重新声明不可声明的类。

我尝试过其他的解决方案,但没有成功。

如果您对如何解决此问题有任何建议,请随时将您的输入留在下面!

更新:

下面是我已经研究了一段时间的模型的代码。

Rankine_HRSG模型

代码语言:javascript
复制
ThermoPower.PowerPlants.HRSG.Components.HE Superheater(
Cfnom_F = 0, 
Cfnom_G = 0, 
FFtype_F = ThermoPower.Choices.Flow1D.FFtypes.NoFriction, 
FFtype_G = ThermoPower.Choices.Flow1D.FFtypes.NoFriction, 
FluidPhaseStart = ThermoPower.Choices.FluidPhase.FluidPhases.Steam, 
HCtype_F = ThermoPower.Choices.Flow1D.HCtypes.Downstream, 
Kfnom_F = 0, 
Kfnom_G = 0, 
N_F = 2, 
N_G = 2, 
Nt = 1, 
Tstartbar_G = 1073.15, 
dpnom_F = 0, 
dpnom_G = 0, 
exchSurface_F = 10, 
exchSurface_G = 10, 
extSurfaceTub = 20, 
fluidNomFlowRate = 50, 
fluidNomPressure = 1e+06, 
fluidVol = 10, 
gasNomFlowRate = 102, 
gasNomPressure = 101325, 
gasQuasiStatic = false, 
gasVol = 10, 
lambda = 366, 
metalVol = 10, 
pstart_F = 5e+06, 
pstart_G = 101325, 
rhonom_F = 1000, 
rhonom_G = 0.33)
  annotation(
Placement(visible = true, transformation(origin = {50, 50}, extent = 
{{-10, -10}, {10, 10}}, rotation = 180)));

ThermoPower.PowerPlants.HRSG.Components.HE Economizer(
Cfnom_F = 0,
Cfnom_G = 0, 
FFtype_F = ThermoPower.Choices.Flow1D.FFtypes.NoFriction, 
FFtype_G = ThermoPower.Choices.Flow1D.FFtypes.NoFriction, 
FluidPhaseStart = ThermoPower.Choices.FluidPhase.FluidPhases.Liquid, 
HCtype_F = ThermoPower.Choices.Flow1D.HCtypes.Downstream, 
Kfnom_F = 0, 
Kfnom_G = 0, 
N_F = 2, 
N_G = 2, 
Nt = 1, 
Tstartbar_G = 1023.15, 
dpnom_F = 0, 
dpnom_G = 0, 
exchSurface_F = 10, 
exchSurface_G = 10, 
extSurfaceTub = 20, 
fluidNomFlowRate = 50, 
fluidNomPressure = 1e+06, 
fluidVol = 10, 
gasNomFlowRate = 102, 
gasNomPressure = 101325, 
gasVol = 10, 
lambda = 366, 
metalVol = 10, 
pstart_F = 5e+06, 
pstart_G = 101325, 
rhonom_F = 1000, 
rhonom_G = 0.33)
  annotation(
Placement(visible = true, transformation(origin = {50, -50}, extent = 
{{-10, -10}, {10, 10}}, rotation = 180)));

ThermoPower.Examples.HRB.Models.Evaporator Evaporator(
Cfnom_G = 0, 
FFtype_G = ThermoPower.Choices.Flow1D.FFtypes.NoFriction, 
Kfnom_G = 0,
N = 2, 
Tstart = 1048.15, 
cm = 376.812, 
dpnom_G = 0, 
exchSurface = 10, 
fluidNomFlowRate = 50, 
fluidNomPressure = 1e+06, 
fluidVol = 10, 
gamma = 300, 
gasNomFlowRate = 102, 
gasNomPressure = 101325, 
gasVol = 10, 
metalVol = 10, 
rhom = 8400, 
rhonom_G = 0.33)
  annotation(
Placement(visible = true, transformation(origin = {50, 0}, extent = {{-10, 
-10}, {10, 10}}, rotation = 180)));

ThermoPower.Gas.SourcePressure FlueGasSource(
redeclare package Medium = ThermoPower.Media.FlueGas, 
R = 0, 
T = 800, 
p0 = 101325)
  annotation(
Placement(visible = true, transformation(origin = {94, 50}, extent = 
{{-10, -10}, {10, 10}}, rotation = 180)));

ThermoPower.Gas.SinkPressure FlueGasSink(
redeclare package Medium = ThermoPower.Media.FlueGas, 
R = 0, 
T = 700, 
p0 = 101325)
  annotation(
Placement(visible = true, transformation(origin = {10, -50}, extent = 
{{-10, -10}, {10, 10}}, rotation = 180)));

ThermoPower.Water.SteamTurbineStodola SteamTurbine(
PRstart = 1,
eta_iso_nom = 0.92, 
explicitIsentropicEnthalpy = true, 
partialArc_nom = 1, 
pnom = 10e5, 
wnom = 50, 
wstart = 50)
  annotation(
Placement(visible = true, transformation(origin = {0, 80}, extent = {{-10, 
-10}, {10, 10}}, rotation = 180)));

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

ThermoPower.Water.Pump Pump(
CheckValve = true,Np0 = 1, 
V = 10, 
dp0 = 0, head(start = 1), 
hstart = 1e5, 
n0 = 150, 
n_const = 150, q_single(fixed = false), rho0 = 1000, 
w0 = 50, 
w_single(fixed = false), 
wstart = 50)
  annotation(
Placement(visible = true, transformation(origin = {-38, -12}, extent = 
{{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Mechanics.Rotational.Sensors.PowerSensor PowerSensor annotation(
Placement(visible = true, transformation(origin = {-38, 68}, extent = 
{{-10, -10}, {10, 10}}, rotation = 180)));

ThermoPower.Electrical.Generator Generator annotation(
Placement(visible = true, transformation(origin = {-68, 68}, extent = 
{{-10, -10}, {10, 10}}, rotation = 180)));

Modelica.Blocks.Continuous.FirstOrder firstOrder1 annotation(
Placement(visible = true, transformation(origin = {-50, 92}, extent = 
{{-8, -8}, {8, 8}}, rotation = 180)));

Modelica.Blocks.Interfaces.RealOutput Power annotation(
Placement(visible = true, transformation(origin = {-110, 0}, extent = 
{{-10, -10}, {10, 10}}, rotation = 180), iconTransformation(origin = 
{-110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
inner ThermoPower.System system annotation(
Placement(visible = true, transformation(origin = {90, 90}, extent = 
{{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(PowerSensor.flange_b, Generator.shaft) annotation(
Line(points = {{-48, 68}, {-59, 68}}));
connect(SteamTurbine.shaft_b, PowerSensor.flange_a) annotation(
Line(points = {{-6, 80}, {-14, 80}, {-14, 68}, {-28, 68}}));
connect(SteamTurbine.outlet, Condenser.steamIn) annotation(
Line(points = {{-8, 72}, {-8, 52}, {-50, 52}, {-50, 40}}, color = {0, 0, 
255}));
connect(Superheater.waterOut, SteamTurbine.inlet) annotation(
Line(points = {{50, 60}, {50, 64}, {8, 64}, {8, 72}}, color = {0, 0, 
255}));
connect(Evaporator.waterOut, Superheater.waterIn) annotation(
Line(points = {{50, 10}, {50, 10}, {50, 40}, {50, 40}}, color = {0, 0, 
255}));
connect(Economizer.waterOut, Evaporator.waterIn) annotation(
Line(points = {{50, -40}, {50, -40}, {50, -10}, {50, -10}}, color = {0, 0, 
255}));
connect(firstOrder1.y, Power) annotation(
Line(points = {{-58, 92}, {-90, 92}, {-90, 0}, {-102, 0}, {-102, 0}, 
{-110, 0}}, color = {0, 0, 127}));
connect(PowerSensor.power, firstOrder1.u) annotation(
Line(points = {{-30, 80}, {-30, 80}, {-30, 92}, {-40, 92}, {-40, 92}, 
{-40, 92}}, color = {0, 0, 127}));
connect(Condenser.waterOut, Pump.infl) annotation(
Line(points = {{-50, 20}, {-50, -10}, {-46, -10}}, color = {0, 0, 255}));
connect(Pump.outfl, Economizer.waterIn) annotation(
Line(points = {{-32, -4}, {-26, -4}, {-26, -80}, {50, -80}, {50, -60}, 
{50, -60}}, color = {0, 0, 255}));
connect(Economizer.gasOut, FlueGasSink.flange) annotation(
Line(points = {{40, -50}, {20, -50}, {20, -50}, {20, -50}}, color = {159, 
159, 223}));
connect(Superheater.gasOut, Evaporator.gasIn) annotation(
Line(points = {{40, 50}, {20, 50}, {20, 30}, {80, 30}, {80, 0}, {60, 0}}, 
color = {159, 159, 223}));
connect(Evaporator.gasOut, Economizer.gasIn) annotation(
Line(points = {{40, 0}, {20, 0}, {20, -26}, {20, -26}, {20, -30}, {80, 
-30}, {80, -50}, {60, -50}, {60, -50}}, color = {159, 159, 223}));
connect(FlueGasSource.flange, Superheater.gasIn) annotation(
Line(points = {{84, 50}, {60, 50}, {60, 50}, {60, 50}}, color = {159, 159, 
223}));

annotation(
uses(ThermoPower(version = "3.1"), Modelica(version = "3.2.2")));end 
Rankine_HRSG;
EN

回答 1

Stack Overflow用户

发布于 2019-02-23 14:53:23

我成功地使用OMEdit v1.12.0 (64位)再现了错误。但是,它似乎是我们正在使用的OpenModelica版本的一个bug。戴莫拉模型相同,没有错误/警告。此外,在OpenModelica中模拟该示例对我也有帮助。此外,使用这一行:

代码语言:javascript
复制
  function flowCharacteristic =
      ThermoPower.Functions.PumpCharacteristics.quadraticFlow (q_nom={1,2,3},
        head_nom={1,2,3});

修复此翻译错误。也许试着下载其他版本的OM。如果使用最新版本,降级,如果使用旧版本,则升级。如果您不能使用我提供的行修复此错误,请提供您正在使用的ThermoLib和OM的版本。

编辑:查看您的模型,有一些问题:

  1. 当您在rankine循环中使用泵时,您必须为流程特性选择一个函数,并给出q_nomhead_nom的值。
  2. 你提供的循环缺少一个推动者。气体必须通过泵或massFlowSource穿过你的循环。
  3. 您声明了一个参数partialArc_nom = 1,它不在ThermoPower的模型SteamTurbine中使用。

修正所有这些误差会导致一个模型,该模型在OM和Dymola中都是平移的,没有误差。由于某些固有的数值和方程会引起麻烦,所以模拟无法工作。通过将每个子模型的固有值传播到顶层来改变气体介质或设置参数initialValues,可以解决这个问题。这也可能是我为参数q_nomhead_nom设置的虚拟值造成的。为这些参数选择物理值取决于您。在为我工作的固定代码下面找到。

代码语言:javascript
复制
model Rankine_HRSG

ThermoPower.PowerPlants.HRSG.Components.HE Superheater(
Cfnom_F = 0,
Cfnom_G = 0,
FFtype_F = ThermoPower.Choices.Flow1D.FFtypes.NoFriction,
FFtype_G = ThermoPower.Choices.Flow1D.FFtypes.NoFriction,
FluidPhaseStart = ThermoPower.Choices.FluidPhase.FluidPhases.Steam,
HCtype_F = ThermoPower.Choices.Flow1D.HCtypes.Downstream,
Kfnom_F = 0,
Kfnom_G = 0,
N_F = 2,
N_G = 2,
Nt = 1,
dpnom_F = 0,
dpnom_G = 0,
exchSurface_F = 10,
exchSurface_G = 10,
extSurfaceTub = 20,
fluidNomFlowRate = 50,
fluidVol = 10,
gasNomFlowRate = 102,
gasQuasiStatic = false,
gasVol = 10,
lambda = 366,
metalVol = 10,
rhonom_F = 1000,
rhonom_G = 0.33,
    gasNomPressure=101325,
    fluidNomPressure=1000000,
    rhomcm=1000,
    Tstartbar_G=1073.15,
    pstart_G=101325,
    pstart_F=5000000)
  annotation (
Placement(visible = true, transformation(origin = {50, 50}, extent=
{{-10, -10}, {10, 10}}, rotation = 180)));

ThermoPower.PowerPlants.HRSG.Components.HE Economizer(
Cfnom_F = 0,
Cfnom_G = 0,
FFtype_F = ThermoPower.Choices.Flow1D.FFtypes.NoFriction,
FFtype_G = ThermoPower.Choices.Flow1D.FFtypes.NoFriction,
FluidPhaseStart = ThermoPower.Choices.FluidPhase.FluidPhases.Liquid,
HCtype_F = ThermoPower.Choices.Flow1D.HCtypes.Downstream,
Kfnom_F = 0,
Kfnom_G = 0,
N_F = 2,
N_G = 2,
Nt = 1,
dpnom_F = 0,
dpnom_G = 0,
exchSurface_F = 10,
exchSurface_G = 10,
extSurfaceTub = 20,
fluidNomFlowRate = 50,
fluidVol = 10,
gasNomFlowRate = 102,
gasVol = 10,
lambda = 366,
metalVol = 10,
rhonom_F = 1000,
rhonom_G = 0.33,
    gasNomPressure=101325,
    fluidNomPressure=1000000,
    rhomcm=1000,
    Tstartbar_G=1023.15,
    pstart_G=101325,
    pstart_F=5000000)
  annotation (
Placement(visible = true, transformation(origin = {50, -50}, extent=
{{-10, -10}, {10, 10}}, rotation = 180)));

ThermoPower.Examples.HRB.Models.Evaporator Evaporator(
Cfnom_G = 0,
FFtype_G = ThermoPower.Choices.Flow1D.FFtypes.NoFriction,
Kfnom_G = 0,
N = 2,
cm = 376.812,
dpnom_G = 0,
exchSurface = 10,
fluidNomFlowRate = 50,
fluidVol = 10,
gamma = 300,
gasNomFlowRate = 102,
gasVol = 10,
metalVol = 10,
rhom = 8400,
rhonom_G = 0.33,
    gasNomPressure=101325,
    fluidNomPressure=1000000,
    Tstart=1048.15)
  annotation (
Placement(visible = true, transformation(origin = {50, 0}, extent = {{-10,
-10}, {10, 10}}, rotation = 180)));

ThermoPower.Gas.SourceMassFlow FlueGasSource(
redeclare package Medium = ThermoPower.Media.FlueGas,
    p0=101325,
    T=800,
    w0=1)
  annotation (
Placement(visible = true, transformation(origin = {94, 50}, extent=
{{-10, -10}, {10, 10}}, rotation = 180)));

ThermoPower.Gas.SinkPressure FlueGasSink(
redeclare package Medium = ThermoPower.Media.FlueGas,
R = 0,
T = 700,
p0 = 101325)
  annotation (
Placement(visible = true, transformation(origin = {10, -50}, extent=
{{-10, -10}, {10, 10}}, rotation = 180)));

ThermoPower.Water.SteamTurbineStodola SteamTurbine(
PRstart = 1,
eta_iso_nom = 0.92,
explicitIsentropicEnthalpy = true,
wnom = 50,
wstart = 50,
    pnom=1000000,
    Kt=1)
  annotation (
Placement(visible = true, transformation(origin = {0, 80}, extent = {{-10,
-10}, {10, 10}}, rotation = 180)));
//partialArc_nom = 1,

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

ThermoPower.Water.Pump Pump(
CheckValve = true,Np0 = 1,
V = 10,
dp0 = 0, head(start = 1),
hstart = 1e5,
n0 = 150,
n_const = 150, q_single(fixed = false), rho0 = 1000,
w0 = 50,
w_single(fixed = false),
wstart = 50,
    redeclare function efficiencyCharacteristic =
        ThermoPower.Functions.PumpCharacteristics.constantEfficiency (eta_nom=0.8),
    redeclare function flowCharacteristic =
        ThermoPower.Functions.PumpCharacteristics.linearFlow (q_nom={0.5,1},
          head_nom={10,15}))
  annotation (
Placement(visible = true, transformation(origin = {-38, -12}, extent=
{{-10, -10}, {10, 10}}, rotation = 0)));

Modelica.Mechanics.Rotational.Sensors.PowerSensor PowerSensor annotation (
Placement(visible = true, transformation(origin = {-38, 68}, extent=
{{-10, -10}, {10, 10}}, rotation = 180)));

ThermoPower.Electrical.Generator Generator annotation (
Placement(visible = true, transformation(origin = {-68, 68}, extent=
{{-10, -10}, {10, 10}}, rotation = 180)));

Modelica.Blocks.Continuous.FirstOrder firstOrder1 annotation (
Placement(visible = true, transformation(origin = {-50, 92}, extent=
{{-8, -8}, {8, 8}}, rotation = 180)));

Modelica.Blocks.Interfaces.RealOutput Power annotation (
Placement(visible = true, transformation(origin = {-110, 0}, extent=
{{-10, -10}, {10, 10}}, rotation = 180), iconTransformation(origin=
{-110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
inner ThermoPower.System system annotation (
Placement(visible = true, transformation(origin = {90, 90}, extent=
{{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(PowerSensor.flange_b, Generator.shaft) annotation (
Line(points={{-48,68},{-59.4,68}}));
connect(SteamTurbine.shaft_b, PowerSensor.flange_a) annotation (
Line(points={{-6.4,80},{-14,80},{-14,68},{-28,68}}));
connect(SteamTurbine.outlet, Condenser.steamIn) annotation (
Line(points = {{-8, 72}, {-8, 52}, {-50, 52}, {-50, 40}}, color = {0, 0,
255}));
connect(Superheater.waterOut, SteamTurbine.inlet) annotation (
Line(points = {{50, 60}, {50, 64}, {8, 64}, {8, 72}}, color = {0, 0,
255}));
connect(Evaporator.waterOut, Superheater.waterIn) annotation (
Line(points = {{50, 10}, {50, 10}, {50, 40}, {50, 40}}, color = {0, 0,
255}));
connect(Economizer.waterOut, Evaporator.waterIn) annotation (
Line(points = {{50, -40}, {50, -40}, {50, -10}, {50, -10}}, color = {0, 0,
255}));
connect(firstOrder1.y, Power) annotation (
Line(points={{-58.8,92},{-90,92},{-90,0},{-102,0},{-102,0},{-110,0}},
            color = {0, 0, 127}));
connect(PowerSensor.power, firstOrder1.u) annotation (
Line(points={{-30,79},{-30,79},{-30,92},{-40,92},{-40,92},{-40.4,92}},
            color = {0, 0, 127}));
connect(Condenser.waterOut, Pump.infl) annotation (
Line(points = {{-50, 20}, {-50, -10}, {-46, -10}}, color = {0, 0, 255}));
connect(Pump.outfl, Economizer.waterIn) annotation (
Line(points={{-32,-5},{-26,-5},{-26,-80},{50,-80},{50,-60},{50,-60}},
            color = {0, 0, 255}));
connect(Economizer.gasOut, FlueGasSink.flange) annotation (
Line(points = {{40, -50}, {20, -50}, {20, -50}, {20, -50}}, color = {159,
159, 223}));
connect(Superheater.gasOut, Evaporator.gasIn) annotation (
Line(points = {{40, 50}, {20, 50}, {20, 30}, {80, 30}, {80, 0}, {60, 0}},
color = {159, 159, 223}));
connect(Evaporator.gasOut, Economizer.gasIn) annotation (
Line(points = {{40, 0}, {20, 0}, {20, -26}, {20, -26}, {20, -30}, {80,
-30}, {80, -50}, {60, -50}, {60, -50}}, color = {159, 159, 223}));
connect(FlueGasSource.flange, Superheater.gasIn) annotation (
Line(points = {{84, 50}, {60, 50}, {60, 50}, {60, 50}}, color = {159, 159,
223}));

annotation (
uses(ThermoPower(version = "3.1"), Modelica(version = "3.2.2")));
end Rankine_HRSG;
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54792756

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档