Opened 6 years ago

Last modified 6 years ago

#5331 new defect

illogical "incompatible components" error in library model replica

Reported by: NRELintern Owned by: somebody
Priority: high Milestone: Future
Component: Frontend Version:
Keywords: Cc:

Description

I am trying to model and replicate the "Open Brayton Power Cycle" from the OpenModelica Library and have come across an error message that makes little sense. The error message is the result of incompatibility between sourceMassflow.mo and CombustionChamber.mo, all taken from the modelica library and connected in the same fashion as the library Brayton example has been done.

This error has occurred after completely replicating the "Brayton Power Cycle - Open" from the modelica library.

This is the error I am receiving. This message almost proves that the two components are compatible with one another however I cannot figure out the reason why they are "not working" together.

Code:// [11] 14:18:40 Translation Error [BraytonCycle_First: 49:3-50:84]: Incompatible components in connect statement: connect(sourceMassFlow1.flange, combustionChamber1.inf) - sourceMassFlow1.flange has components {C_outflow, Xi_outflow, h_outflow, m_flow, p} - combustionChamber1.inf has components {C_outflow, Xi_outflow, h_outflow, m_flow, p}

I copied all of the library's component parameters into my model and expected this to solve the issue. Nothing I have done fixes this issue, where it seems that these models would be compatible due to the error message above.

Any help or advice would be greatly appreciated.

Attachments (2)

BraytonCycleLibraryReplica.mo (9.0 KB ) - added by kieranroyfung@… 6 years ago.
BraytonCycleLibraryReplica_fixed_redeclares.mo (9.0 KB ) - added by Adrian Pop 6 years ago.

Download all attachments as: .zip

Change History (6)

by kieranroyfung@…, 6 years ago

comment:1 by Adrian Pop, 6 years ago

The error message is actually correct, but very bad, it should include the types of the components. The problem is that in the connectors there is a replaceable medium package and the types from this medium are used:

connector Flange "Flange connector for gas flows"
  replaceable package Medium = Modelica.Media.Interfaces.PartialMedium;
  flow Medium.MassFlowRate m_flow
    "Mass flow rate from the connection point into the component";
  Medium.AbsolutePressure p "Thermodynamic pressure in the connection point";
  stream Medium.SpecificEnthalpy h_outflow
    "Specific thermodynamic enthalpy close to the connection point if m_flow < 0";
  stream Medium.MassFraction Xi_outflow[Medium.nXi]
    "Independent mixture mass fractions m_i/m close to the connection point if m_flow < 0";
  stream Medium.ExtraProperty C_outflow[Medium.nC]
    "Properties c_i/m close to the connection point if m_flow < 0";
end Flange;

This means that the medium in both right hand side and left hand side connectors in the connect equations needs to be redeclared to be the same.

I will try to adapt the model to do that.

Last edited 6 years ago by Adrian Pop (previous) (diff)

comment:2 by Adrian Pop, 6 years ago

Component: *unknown*Frontend

comment:3 by Adrian Pop, 6 years ago

The attached model compiles.

comment:4 by Adrian Pop, 6 years ago

The NF doesn't give a better message as well.

Note: See TracTickets for help on using tickets.