如何解决错误,“模型在结构上是奇异的,发现方程式排序时出错”

时间:2019-03-14 19:42:50

标签: modelica dymola openmodelica jmodelica

这是使用OpenModelica软件时收到的最常见错误之一。

我已经了解,当系统参数相互冲突且彼此不同时,通常会触发此错误。

我已经尝试省略我认为对系统来说不是必需的系统参数,但是似乎没有什么可以解决该错误。

我的系统开始非常简单。目前,我正在进行子装配验证过程,以正确构建有效的Rankine Power模型。该子组件着重于(2)个热交换器中的(1)个,该热交换器将在双重HX系统中使用,该系统在高压和低压涡轮之间引入了再加热过程。

此子组件试图描述以冷凝液态来自泵的水,水将流经热交换器“过热器”,在热交换器中,水将从压缩液体变为过热蒸汽。然后,这些蒸气将被送入高压涡轮,并返回到压力降。

我已经完成了系统的手动热力学分析,并且知道出口温度和焓。但是,这些出口参数是我选择删除的一些参数,因为我觉得我会让系统解决这些问题,而不是告诉它应该计算什么。删除这些值以解决错误不能正常工作。

如果您有任何想法,建议或考虑,请告诉我!下面,我将代码发布到了我一直在努力的地方。再次感谢!

代码:

model HX_Pump_2_Superheater_2_HPTurbine

//Heat Exchanger - Steam entering HX (compressed liquid) --> Steam exiting 
HX (super heated vapor)//
//Steam Turbine - High Pressure Turbine and is (1) of (2) in series with one 
another. Exit pressure should be intermediate pressure level before being 
reheated and directed towards Low Pressure Turbine//

ThermoPower.PowerPlants.HRSG.Components.HE HX(
FluidPhaseStart = ThermoPower.Choices.FluidPhase.FluidPhases.Liquid, 
Tstartbar_G (displayUnit = "K") = 787.87, 
dpnom_F(displayUnit = "Pa") = 0, 
dpnom_G = 0, 
exchSurface_F = 4.739, 
exchSurface_G = 4.739, 
extSurfaceTub = 9.479, 
fluidNomFlowRate = 26.397, 
fluidNomPressure = 8e+06, 
fluidVol = 0.0296, 
gasNomFlowRate = 169.755, 
gasNomPressure = 101325, 
gasVol = 0.0296, 
lambda = 20, 
metalVol = 5, 
pstart_F = 8e+06, 
pstart_G = 101325, 
rhomcm = 1, 
rhonom_F(displayUnit = "kg/m3") = 0.6, 
rhonom_G(displayUnit = "kg/m3") = 0.33)  annotation(
Placement(visible = true, transformation(origin = {-1.9984e-15, 14}, extent 
= {{-20, -20}, {20, 20}}, rotation = 0)));

ThermoPower.Gas.SinkPressure sinkPressure1(
redeclare package Medium = ThermoPower.Media.FlueGas, 
T = 106.86 + 273, 
p0 = 101325) annotation(
Placement(visible = true, transformation(origin = {92, 14}, extent = {{-10, 
-10}, {10, 10}}, rotation = 0)));

ThermoPower.Gas.SensT sensT1(
redeclare package Medium = ThermoPower.Media.FlueGas, 
allowFlowReversal = false) annotation(
Placement(visible = true, transformation(origin = {-50, 18}, extent = {{-10, 
-10}, {10, 10}}, rotation = 0)));

ThermoPower.Gas.SensT sensT2(
redeclare package Medium = ThermoPower.Media.FlueGas, 
allowFlowReversal = false) annotation(
Placement(visible = true, transformation(origin = {50, 18}, extent = {{-10, 
-10}, {10, 10}}, rotation = 0)));

ThermoPower.Water.SinkPressure sinkPressure2(
redeclare package Medium = ThermoPower.Water.StandardWater, 
T = 165 + 273, 
h = 2536.2092e5, 
p0 = 7.0e5) annotation(
Placement(visible = true, transformation(origin = {92, -60}, extent = {{-10, 
-10}, {10, 10}}, rotation = 0)));

ThermoPower.Water.SensT sensT3(
redeclare package Medium = ThermoPower.Water.StandardWater) annotation(
Placement(visible = true, transformation(origin = {4, 64}, extent = {{-10, 
-10}, {10, 10}}, rotation = -90)));

ThermoPower.Water.SensT sensT4(
redeclare package Medium = ThermoPower.Water.StandardWater, 
allowFlowReversal = false) annotation(
Placement(visible = true, transformation(origin = {4, -32}, extent = {{-10, 
-10}, {10, 10}}, rotation = -90)));

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

ThermoPower.Gas.SourceMassFlow sourceMassFlow1(
redeclare package Medium = ThermoPower.Media.FlueGas, 
T = 514 + 273, 
p0 = 101325,
w0 = 169.755) annotation(
Placement(visible = true, transformation(origin = {-90, 14}, extent = {{-10, 
-10}, {10, 10}}, rotation = 0)));

ThermoPower.Water.SourceMassFlow sourceMassFlow2(
redeclare package Medium = ThermoPower.Water.StandardWater, 
T = 42.88 + 273, 
h = 183.1e3, 
p0 = 80e5, 
use_T = true, 
w0 = 26.397) annotation(
Placement(visible = true, transformation(origin = {2, 92}, extent = {{-10, 
-10}, {10, 10}}, rotation = -90)));

ThermoPower.Water.SteamTurbineStodola steamTurbineStodola1(
Kt = 0.01328, 
PRstart = 11.43, 
explicitIsentropicEnthalpy = false, 
pnom = 80.0e5, 
pout(fixed = false), 
w(fixed = false), 
wnom = 26.397, 
wstart = 26.397)  annotation(
Placement(visible = true, transformation(origin = {12, -72}, extent = {{-14, 
-14}, {14, 14}}, rotation = 0)));

equation
connect(sensT2.outlet, sinkPressure1.flange) annotation(
Line(points = {{56, 14}, {82, 14}}, color = {159, 159, 223}));
connect(steamTurbineStodola1.outlet, sinkPressure2.flange) annotation(
Line(points = {{24, -60}, {82, -60}, {82, -60}, {82, -60}}, color = {0, 0, 
255}));
connect(sensT4.outlet, steamTurbineStodola1.inlet) annotation(
Line(points = {{0, -38}, {0, -38}, {0, -60}, {0, -60}}, color = {0, 0, 
255}));
connect(HX.waterOut, sensT4.inlet) annotation(
Line(points = {{0, -6}, {0, -26}}, color = {0, 0, 255}));
connect(sourceMassFlow1.flange, sensT1.inlet) annotation(
Line(points = {{-80, 14}, {-56, 14}}, color = {159, 159, 223}));
connect(sensT3.outlet, HX.waterIn) annotation(
Line(points = {{0, 58}, {0, 58}, {0, 34}, {0, 34}}, color = {0, 0, 255}));
connect(sourceMassFlow2.flange, sensT3.inlet) annotation(
Line(points = {{0, 82}, {0, 70}}, color = {0, 0, 255}));
connect(HX.gasOut, sensT2.inlet) annotation(
Line(points = {{20, 14}, {44, 14}, {44, 14}, {44, 14}}, color = {159, 159, 
223}));
connect(sensT1.outlet, HX.gasIn) annotation(
Line(points = {{-44, 14}, {-20, 14}, {-20, 14}, {-20, 14}}, color = {159, 
159, 223}));
annotation(
uses(ThermoPower(version = "3.1"), Modelica(version = "3.2.3")));end 
HX_Pump_2_Superheater_2_HPTurbine;

1 个答案:

答案 0 :(得分:1)

Dymola中的错误消息显示:

  

HX_Pump_2_Superheater_2_HPTurbine模型在结构上是单一的。

     

对于Real类型的元素,该问题在结构上是单一的。

     

标量Real未知元素的数量为93。   标量实数方程元素为93。

     

以下变量被视为未知变量,但不是   出现在方程式中steamTurbineStodola1.phi

     

Real元素的部分问题已被确定。有1个   标量方程组过多:   ...

重要的部分是steamTurbineStodola1.phi没有出现在方程式中。这是涡轮轴的角度,它表明涡轮轴只是“自由浮动”。 添加惯性并将其连接到轴可以避免该问题:

public
  Modelica.Mechanics.Rotational.Components.Inertia inertia
    annotation (Placement(transformation(extent={{28,-82},{48,-62}})));
equation
connect(steamTurbineStodola1.shaft_b, inertia.flange_a)
    annotation (Line(points={{20.96,-72},{28,-72}}, color={0,0,0}));

但是还有其他与低压等相关的问题。

显然,仅将惯性与默认惯性相加并不是正确的模型-但我相信它可以指示要做什么。