- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » about the use outer and inner variables
about the use outer and inner variables
about the use outer and inner variables
Hello there,
I need to share a variable, beta_c, between two classes, which behave at two different packages Compressor and Turbine.
I put this variable as global (inner tag) in a class which behaves at a package, Turbocharger, which contains the two package Compressor and Turbine.
So the class in Compressor and Turbine, are able to reference to it by the tag outer.
I have some doubt, if I did that in the right way,
this is the code:
I'm wondering
package Turbocharger
partial class Coupling Parameters
inner Real beta_c (start=0.1);
end Coupling Parameters;
package Turbine
......
class TurbineQpTW
outer Real beta_c (start=0.1);
equation
..............
beta_c = .........;
..............
end TurbineQpTW;
......
end Turbine;
package Compressor
...........................
class CompressorQpTW
...........................
outer Real beta_c (start=0.1);
...........................
end CompressorQpTW;
...........................
end Compressor;
end Turbocharger;
I'm wondering why when I try to compile I receive every-time this message:
This class has a top-level outer beta_c, you can use this class as a sub-component.
You have to add an inner element when using this.
component context: beta_c
component declared as Real beta_c
I'm wondering if it should be better if I put this variable like an input for the compressor and an input and an output for the turbine. The variable beta_c is modified only in the turbine, but I'm not able to predict the causality of this system, that is to say I don't know if the compressor will be the first to work or it will be the turbine
have a good day
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » about the use outer and inner variables