我正在非常努力地尝试在OpenModelica上对Rankine电源循环建模。这是通过复制ThermoPower库“ RankineCycle”示例的图表视图来完成的。进行了简化,以期简化此过程。
我一直从OM消息浏览器收到“翻译警告”,告诉我正在使用的所有这些组件都没有与“外部声明”相关联的“内部声明”,这些“内部声明”已经分别嵌入在每个组件的库代码中。
我试图手动进入与每个组件翻译警告相关的代码,并添加所说的“内部声明”,但这在解决问题上没有成功。
我还尝试在外部代码声明中添加“ //”,以希望也无法成功省略这些命令。
代码如下:
[1] 11:52:20 Translation Warning
[ThermoPower.Water: 5482:7-5482:63]: No corresponding 'inner' declaration found for component .ThermoPower.System Superheater.fluidFlow.system declared as 'outer '.
The existing 'inner' components are:
There are no 'inner' components defined in the model in any of the parent scopes of 'outer' component's scope: ThermoPower.Water.Flow1DFV$Superheater$fluidFlow.
Check if you have not misspelled the 'outer' component name.
Please declare an 'inner' component with the same name in the top scope.
Continuing flattening by only considering the 'outer' component declaration.
[2] 11:52:20 Translation Warning
[ThermoPower.Thermal: 374:5-374:61]: No corresponding 'inner' declaration found for component .ThermoPower.System Superheater.metalTube.system declared as 'outer '.
The existing 'inner' components are:
There are no 'inner' components defined in the model in any of the parent scopes of 'outer' component's scope: ThermoPower.Thermal.MetalTubeFV$Superheater$metalTube.
Check if you have not misspelled the 'outer' component name.
Please declare an 'inner' component with the same name in the top scope.
Continuing flattening by only considering the 'outer' component declaration.
[3] 11:52:20 Translation Warning
[ThermoPower.Gas: 2791:7-2791:63]: No corresponding 'inner' declaration found for component .ThermoPower.System Superheater.gasFlow.system declared as 'outer '.
The existing 'inner' components are:
There are no 'inner' components defined in the model in any of the parent scopes of 'outer' component's scope: ThermoPower.Gas.Flow1DFV$Superheater$gasFlow.
Check if you have not misspelled the 'outer' component name.
Please declare an 'inner' component with the same name in the top scope.
Continuing flattening by only considering the 'outer' component declaration.
[4] 11:52:20 Translation Warning
[ThermoPower.Water: 5482:7-5482:63]: No corresponding 'inner' declaration found for component .ThermoPower.System Economizer.fluidFlow.system declared as 'outer '.
The existing 'inner' components are:
There are no 'inner' components defined in the model in any of the parent scopes of 'outer' component's scope: ThermoPower.Water.Flow1DFV$Economizer$fluidFlow.
Check if you have not misspelled the 'outer' component name.
Please declare an 'inner' component with the same name in the top scope.
Continuing flattening by only considering the 'outer' component declaration.
[5] 11:52:20 Translation Warning
[ThermoPower.Thermal: 374:5-374:61]: No corresponding 'inner' declaration found for component .ThermoPower.System Economizer.metalTube.system declared as 'outer '.
The existing 'inner' components are:
There are no 'inner' components defined in the model in any of the parent scopes of 'outer' component's scope: ThermoPower.Thermal.MetalTubeFV$Economizer$metalTube.
Check if you have not misspelled the 'outer' component name.
Please declare an 'inner' component with the same name in the top scope.
Continuing flattening by only considering the 'outer' component declaration.
等...等...再输入10行
以上尝试的解决方案均未真正起作用。幸运的是,这些只是警告,并没有完全破坏代码,但似乎确实有一个问题需要解决。
每次我想麻烦拍摄代码时,它都会使我进入扩展该组件的库代码。我认为这可能会发生真正的编辑,但是我所做的任何更改都不会影响我的模型。
答案 0 :(得分:4)
某些Modelica工具会自动添加内部声明,有些则不会。 OpenModelica尚未自动添加它,但将来会随着新的前端而改变。
只需将ThermoPower.System拖放到顶级模型中,就足够了。您无需将其添加到每个级别,只需将其添加到顶层。内部声明就像一个由外部声明读取的全局变量。
答案 1 :(得分:1)
除了艾德里安(Adrian)写的东西(因为它弹出时是活跃的):
Modelica语言规范已针对缺少内部内容进行了更改:
在3.0中,missingInnerMessage注释仅用于诊断,但是自然会导致带有警告提示的自动更正,然后在3.1-3.2中进行了标准化,其中注释允许工具添加相应的内部提示-但没有这样做。不需要它;导致模型在某些工具中起作用,而在其他工具中不起作用。
最后,在3.3r1和3.4中,工具应临时添加相应的内部-不管missingInnerMessage(如果是明确的和非部分的)。
因此,它将继续有效。