modelicaopenmodelica

Modelica: Class not found in scope


I am trying to create my own GreenEnergy library in OpenModelica. I reproduced a similar structure of the library to Modelica Standard Library, but unfortunately receiving the next error:

...
[GreenEnergy.Validation.Wall: 5:3-5:312]: Class GreenEnergy.HeatTransfer.Components.Wall not found in scope GreenEnergy.Validation.Wall.
...

I have next file(and its content) structure:

GreenEnergy

And then I am trying to run Validation.Wall model... So, why I am receiving error that component is not found in scope?

Best


Solution

  • The problem is in the next packages code:

    extends Modelica.Thermal.HeatTransfer;
    

    and

    extends Modelica.Thermal.HeatTransfer.Components;
    

    When I replaced those lines with the simpler line:

    extends Modelica.Icons.Package;
    

    Problem disappeared.

    Modelica.Thermal.HeatTransfer package contains those lines at the beginning:

    within Modelica.Thermal;
    

    but Modelica.Icons.Package is declared in a different way by using partial keyword. More details about partial keyword here.

    Best.