1

I have running a model with a block composed of several interfaces (thermal ports). The dimension of the port is variable and sometime can be up to 20x20... When I run the simulation, the calculation are performed (slowly) but the worst part is when the simulation is done and has to prepare all the data (results)..

In the list of the result there are 20x20 of each interface ! this take several minutes to appears. I don't need to know the ports values and I want to hide it.

I tried this :

  • Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a F6[Nw, Nh] annotation(HideResult = true, Placement(visible = true, transformation(origin = {120, -94}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {150, 120}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

but it is still showing the result...

Also, I can't use "protected" as I need to access the port in a global model, but also to some variables of the block which are calculated.

Do you have any solution ?

Thanks for your help :)

2
  • Seems like a tool specific issue. Which Modelica tool are you using? Commented Jan 6, 2023 at 12:48
  • @Manuel I am using openmodelica v1.19 Commented Jan 7, 2023 at 13:41

1 Answer 1

1

HideResult annotation is exactly for this purpose.

I tried a minimal example in OpenModelica v1.19.2 and that works as expected.

model HideResult

  Real public_var = 1;
  Real hidden_var = 2 annotation(HideResult=true );

equation

end HideResult;

I guess your issue is related to the array definition of heat ports. You could instead apply the HideResult annotation to single variables inside the connector defintion.

That means, define you own connector class and apply the annotation there.

If you keep everything else unchanged (type and name of variables), your customized connector is 100% compatible.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your answer. But, I can't hide a port ? not the variables in the port, but the port itself in the result box ? If I am right, Your solution hide the results only in the port, but not the port itself, no ? My problem is that I have sometime a 20x20 port array, and this lead me to have 400 port in the results.
Checking the Modelica specification it should work for connectors, too. And it does work in Dymola. Seems like a Issue in OpenModelica. You can check the latest released version. If it doesn't work there, report this issue to OpenModelica. Minimal example: Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort(T=300) annotation(HideResult=true);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.