我目前正在通过尝试一些非常简单的示例来学习 Modelica。我为不可压缩流体定义了一个连接器Incompressible
,如下所示:
connector Incompressible
flow Modelica.SIunits.VolumeFlowRate V_dot;
Modelica.SIunits.SpecificEnthalpy h;
Modelica.SIunits.Pressure p;
end Incompressible;
我现在希望定义质量或体积流量源:
model Source_incompressible
parameter Modelica.SIunits.VolumeFlowRate V_dot;
parameter Modelica.SIunits.Temperature T;
parameter Modelica.SIunits.Pressure p;
Incompressible outlet;
equation
outlet.V_dot = V_dot;
outlet.h = enthalpyWaterIncompressible(T); // quick'n'dirty enthalpy function
outlet.p = p;
end Source_incompressible;
但是,当检查Source_incompressible
时,我得到了这个:
The problem is structurally singular for the element type Real.
The number of scalar Real unknown elements are 3.
The number of scalar Real equation elements are 4.
我在这里不知所措。显然,模型中有三个方程 - 第四个方程从何而来?
非常感谢您的见解。
最佳答案
多米尼克,
这里出现了几个问题。正如马丁指出的那样,连接器是不平衡的(该连接器中没有匹配的“直通”和“跨接”对)。对于流体系统,这是可以接受的。然而,密集的流体属性(例如,焓)必须标记为所谓的“流”变量。
诚然,这个话题相当复杂。我计划在我的 online Modelica book 中添加一个高级章节。关于这个话题,但我还没有时间。同时,我建议您查看 Modelica.Fluid
库和/或 this presentation作者之一,Francesco Casella。
关于connector - 实现非常简单的质量流量源时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23811595/