Почему ВСЕ импортированные компоненты библиотеки ThermoPower не имеют «соответствующих« внутренних »объявлений»? - PullRequest
0 голосов
/ 15 февраля 2019

Я очень стараюсь с небольшим успехом смоделировать энергетический цикл Рэнкина на OpenModelica.Это делается путем репликации представления схемы из примера библиотеки «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.

Etc ... Etc ... forеще 10 строк

Ни одно из указанных выше решений на самом деле не сработало.К счастью, это всего лишь предупреждения и они не полностью нарушают код, но, похоже, здесь есть проблема, которую необходимо решить.

Каждый раз, когда я хочу, чтобы код сработал, он запускает меня в библиотечный код, расширяющий этот компонент.Я думаю, что именно здесь может произойти реальное редактирование, но любые изменения, которые я делаю, не влияют на мою модель.

1 Ответ

0 голосов
/ 15 февраля 2019

Некоторые инструменты Modelica добавляют внутреннюю декларацию автоматически, некоторые - нет.OpenModelica еще не добавляет его автоматически, но это изменится в будущем с новым интерфейсом.

Просто перетащите ThermoPower.System в топ-модель, и этого должно быть достаточно.Вам не нужно добавлять его на каждый уровень, только на верхний уровень.Внутреннее объявление похоже на глобальную переменную, которая читается внешним объявлением.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...