Opened 10 years ago

Last modified 8 years ago

#2895 assigned defect

Error translating new Medium package

Reported by: andreabr@… Owned by: adrpo
Priority: high Milestone: Future
Component: Frontend Version: trunk
Keywords: Cc:

Description

Hi,

I wrote a package for a new Medium which I need to run my models. It is a mixture of table-based incompressible liquids. I have tested it on a very simple model (two incompressible liquids, two Boundary_pT each containing a different fluid, two valves, a pipe where the two liquids are mixed, and a Boundary_pT at atmospheric pressure) and I am able to run it. When I just change a few parameters or I increase the complexity of the model (for example by adding a pump) the model crashes.

Now I have tried to test my Medium using Modelica.Media.Examples.Tests.Components.PartialTestModel and I got the following error message:

[CodegenC.tpl:10494:39-10494:39] Error: Template error: Unknown dimensions may not be part of generated code. This is most likely an error on the part of OpenModelica. Please submit a detailed bug-report.

What shall I do?

Thanks in advance for your help.

Regards,
Andrea.

Attachments (3)

MixtureIncompressibleLiquid.mo (19.6 KB) - added by andreabra@… 10 years ago.
New medium package
TestOfMediumPipelineOil.mo (472 bytes) - added by andreabr@… 10 years ago.
Test of my medium
MultiSubstanceLiquid.mo (5.4 KB) - added by andreabr@… 10 years ago.
Model

Download all attachments as: .zip

Change History (8)

comment:1 follow-up: Changed 10 years ago by sjoelund.se

If you use mos-script or OMShell, I would suggest:
saveTotalModel("total.mo", Path.To.Class.To.Simulate); and attaching this model to the ticket. Or creating a minimal model that triggers the error if you do not want to upload the full model.

comment:2 in reply to: ↑ 1 Changed 10 years ago by anonymous

Replying to sjoelund.se:

If you use mos-script or OMShell, I would suggest:
saveTotalModel("total.mo", Path.To.Class.To.Simulate); and attaching this model to the ticket. Or creating a minimal model that triggers the error if you do not want to upload the full model.

I have attached the package that I coded for my new Medium and a very simple test which triggers the error.
Thank you for the very quick reply.
Regards,
Andrea.

Changed 10 years ago by andreabra@…

New medium package

Changed 10 years ago by andreabr@…

Test of my medium

comment:3 follow-up: Changed 10 years ago by sjoelund.se

  • Component changed from Unknown to Frontend
  • Owner changed from somebody to adrpo
  • Status changed from new to assigned

Adrian: These are record constants with unknown dimensions from what I can tell (data[1] is part of the flat Modelica, but no such constant exists). Something with constant evaluation fails.

Changed 10 years ago by andreabr@…

Model

comment:4 in reply to: ↑ 3 Changed 10 years ago by anonymous

Replying to sjoelund.se:

Adrian: These are record constants with unknown dimensions from what I can tell (data[1] is part of the flat Modelica, but no such constant exists). Something with constant evaluation fails.

In some cases the medium package works correctly, in other cases I get the error message. I attach a model where the medium package works correctly, I hope it helps.

comment:5 Changed 8 years ago by anonymous

I know it has been a long time since this was opened. Were you ever able to resolve it? I am getting the same error for a model I'm building.

Note: See TracTickets for help on using tickets.