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

Error while redeclaring medium models

Error while redeclaring medium models

I am having an issue with the redeclaration of Medium models in OMEdit 1.13.2.
I tried to check the model Buildings.Fluid.Boilers.Examples.BoilerPolynomial from the Buildings library v5.1.0 and I got the following error:

Code:


Translation Error
[Buildings.Fluid.Boilers.Examples.BoilerPolynomial: 28:3-39:70]: component boi1 contains the definition of a partial class Medium.
Please redeclare it to any package compatible with Modelica.Media.Interfaces.PartialMedium.

I don't understand this error since the component boi1 is declared in the example as:

Code:


package Medium = Buildings.Media.Water "Medium model";
Buildings.Fluid.Boilers.BoilerPolynomial boi1(
    a={0.9},
    effCur=Buildings.Fluid.Types.EfficiencyCurves.Constant,
    Q_flow_nominal=Q_flow_nominal,
    m_flow_nominal = m_flow_nominal,
    redeclare package Medium = Medium,
    dp_nominal=dp_nominal,
    fue=Buildings.Fluid.Data.Fuels.NaturalGasLowerHeatingValue(),
    energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
    from_dp=true,
    T_start=293.15);

I can not predictably reproduce this for other fluid components like source and sink as the same error does not occur for them even though they have similar redeclaration of the Medium. I also got no such error for this model in Dymola. 

Is this a bug in OMEdit or is this an error in the model?

I have also noticed that when a component is duplicated all the parameters get copied but not the redeclarations (like Medium package). Could this be related to the above issue?

Re: Error while redeclaring medium models

I suggest you use the latest nighlty-build and activate the new front-end:
https://build.openmodelica.org/omc/buil … ly-builds/

Buildings.Fluid.Boilers.Examples.BoilerPolynomial works with the new front-end but doesn't work with the current one:
The coverage of buildings with the new front-end is here:
https://libraries.openmodelica.org/bran … atest.html
The coverage of buildings with the current front-end is here:
https://libraries.openmodelica.org/bran … atest.html

To activate the new front-end you go in OMEdit->Tools->Options->Simulation->Additional Translation Flags: and add newInst to the existing flags or if none there just say: -d=newInst

Edited by: adrpo - Jul-01-19 10:29:54
There are 0 guests and 0 other users also viewing this topic
You are here: