fin*_*uss 2 modelica openmodelica
我正在非常努力地尝试在OpenModelica上为Rankine电源循环建模,但收效甚微。这是通过复制ThermoPower库“ RankineCycle”示例的图表视图来完成的。为了简化此过程,已进行了简化。
我一直从OM Message Browser中收到“翻译警告”,告诉我正在使用的所有这些组件都没有与已经分别嵌入在库代码中的“外部声明”相关联的“内部声明”。
我尝试手动进入与每个组件翻译警告关联的代码,并添加所说的“内部声明”,但这在解决问题上没有成功。
我还尝试过在外部代码声明中添加“ //”,以希望也无法成功省略这些命令。
这是代码:
[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.
Run Code Online (Sandbox Code Playgroud)
等...另10行
上面尝试的解决方案均未真正起作用。幸运的是,这些只是警告,并没有完全破坏代码,但似乎确实有一个问题需要解决。
每当我想麻烦编写代码时,它都会使我进入扩展该组件的库代码。我认为这可能会发生真正的编辑,但是我所做的任何更改都不会影响我的模型。
一些Modelica工具会自动添加内部声明,而有些则不会。OpenModelica尚未自动添加它,但将来会随着新的前端而改变。
只需将ThermoPower.System拖放到顶级模型中,就足够了。您无需将其添加到每个级别,只需将其添加到顶层。内部声明就像一个由外部声明读取的全局变量。