难以实现一个非常简单的质量流量源 [英] Trouble implementing a very simple mass flow source

查看:70
本文介绍了难以实现一个非常简单的质量流量源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在通过尝试一些非常简单的示例来学习 Modelica.我已经为这样的不可压缩流体定义了一个连接器 Incompressible:

I am currently learning Modelica by trying some very simple examples. I have defined a connector Incompressible for an incompressible fluid like this:

connector Incompressible
  flow Modelica.SIunits.VolumeFlowRate V_dot;
  Modelica.SIunits.SpecificEnthalpy h;
  Modelica.SIunits.Pressure p;
end Incompressible;

我现在想定义质量或体积流量源:

I now wish to define a mass or volume flow source:

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 时,我得到了:

However, when checking Source_incompressible, I get this:

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.

我在这里不知所措.显然,模型中有三个方程——第四个方程从何而来?

I am at a loss here. Clearly, there are three equations in the model - where does the fourth equation come from?

非常感谢您的任何见解.

Thanks a lot for any insight.

推荐答案

Dominic,

这里有几个问题.正如马丁指出的那样,连接器是不平衡的(该连接器中没有匹配的直通"和交叉"对).对于流体系统,这是可以接受的.然而,强烈的流体特性(例如,焓)必须被标记为所谓的流"变量.

There are a couple of issues going on here. As Martin points out, the connector is unbalanced (you don't have matching "through" and "across" pairs in that connector). For fluid systems, this is acceptable. However, intensive fluid properties (e.g., enthalpy) have to be marked as so-called "stream" variables.

诚然,这个话题相当复杂.我打算在我的在线 Modelica 书籍 中添加一个关于这个主题的高级章节,但我还没有时间还没有.同时,我建议您查看 Modelica.Fluid 库和/或 本演示文稿,作者之一 Francesco Casella.

This topic is, admittedly, pretty complicated. I'm planning on adding an advanced chapter to my online Modelica book on this topic but I haven't had the time yet. In the meantime, I would suggest you have a look at the Modelica.Fluid library and/or this presentation by one of its authors, Francesco Casella.

这篇关于难以实现一个非常简单的质量流量源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆