Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Translation Error of standard example from MSL Modelica.Media.Examples

Translation Error of standard example from MSL Modelica.Media.Examples

Good mornig
I setup OpenModelica 1.9.4~dev-675-gb524b08 and I try to execute example Modelica.Media.Examples.Tests.Components.PortVolume
and get the next error:

Code:

[1] 06:58:44 Translation Error

[Modelica.Media: 3269:9-3271:35]: Medium is partial, name lookup is not allowed in partial classes.

[2] 06:58:44 Translation Error
[Modelica.Media: 3272:9-3274:30]: Medium is partial, name lookup is not allowed in partial classes.

[3] 06:58:44 Translation Error
[Modelica.Media: 3278:9-3282:30]: Medium is partial, name lookup is not allowed in partial classes.

[4] 06:58:44 Translation Error
[Modelica.Media: 3283:9-3286:30]: Medium is partial, name lookup is not allowed in partial classes.

[5] 06:58:44 Translation Error
[Modelica.Media: 3293:9-3293:65]: Medium is partial, name lookup is not allowed in partial classes.

[6] 06:58:44 Translation Error
[Modelica.Media: 4478:17-4603:23]: Illegal to instantiate partial class BaseProperties$medium.

[7] 06:58:44 Translation Error
Error occurred while flattening model Modelica.Media.Examples.Tests.Components.PortVolume

Please give me please some advice about it?

Edited by: vserge - Jan-26-16 06:17:04

Re: Translation Error of standard example from MSL Modelica.Media.Examples

This errors it's a result of #2079, #2959?

how to write correct modelica code for fluid and gas and simulate it on OpenModelica?

Re: Translation Error of standard example from MSL Modelica.Media.Examples

Hi,

You cannot use those models directly as they have a partial medium defined inside. You need to redeclare the Medium model when you use these models.

Cheers,
Adrian Pop/

Re: Translation Error of standard example from MSL Modelica.Media.Examples

Adrian,
I think in Modelic.Media.Examples must be a working examples, because it's verified and tested ready for demonstrating solutions.

Re: Translation Error of standard example from MSL Modelica.Media.Examples

Yes,  most of them should work but some of therm are there as partial components of the bigger examples.
Even if you use Dymola you cannot compile those models. For example this is what you get when you try to simulate Modelica.Media.Examples.Tests.Components.PortVolume:

Code:


Translation of Modelica.Media.Examples.Tests.Components.PortVolume:

Component type specifier BaseProperties is a partial type.
File: F:/bin/Dymola2015FD01/Modelica/Library/Modelica 3.2.1/Media/package.mo, line 3195
Component context: medium
Component declared as Medium.BaseProperties medium in Modelica.Media.Interfaces.PartialMedium

ERROR: 1 error was found

Re: Translation Error of standard example from MSL Modelica.Media.Examples

Thank you.
I try to use this examples in my models for experiments.

There are 0 guests and 0 other users also viewing this topic
You are here: