0

I am using Thermal Power Library from Modelon. There is a condenser component in the Thermal Power Library which is used for the modeling of power plants. The default heat transfer area for the wall_2 in the condenser component is 0.8*A_heat_tot, the variable of A_heat_tot is an inner variable in the condenser component, but when I try to use this variable, there is an error showing that this variable isn’t defined.

My question is that If I can use the inner variable directly. If not, how should I use it?

enter image description here enter image description here enter image description here

Jack
  • 1,094
  • 6
  • 16

1 Answers1

5

Short answer: You need to address the variable with its full path, i.e. wall_2.A_heat_tot.

A_heat_tot is define in StandardWall and can thus be referred to directly inside the class. However, when you are making changes to A_heat from outside the instance of StandardWall (i.e. outside wall_2) you must point to the origin of A_heat_tot since it is otherwise not known in the scope from which you are trying to use it.

Likewise, if you are making the modification in you simulation model (Preheater_Model_Validation2) you must use the full path, i.e. hex.wall_2.A_heat = hex.A_heat_tot

By the way, this has nothing to do with the inner qualifier in the Modelica language.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Rene Just Nielsen
  • 3,023
  • 12
  • 15
  • Thank you for your help. But the problem is that `A_heat_tot` is defined in the `Condenser` component, so I think it could be referred to directly. – Jack Jan 10 '20 at 08:10
  • 1
    I would recommend trying to use the full qualified path, Rene should be right here. E.g. `ModelName.ComponentName.ComponentName.AttributeName`, note that i started from the very top level which is your model. If the variable is not protected you should be able to access it from anywhere. – kabdelhak Jan 10 '20 at 12:28