Opened 4 years ago

Closed 4 years ago

#6096 closed defect (fixed)

Issues with redeclare in Buildings

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 1.16.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Please check Buildings.Electrical.AC.ThreePhasesBalanced.Lines.Examples.ACSimpleGridMedium. The NF fails with

[/var/lib/jenkins/ws/OpenModelicaLibraryTestingWork/OpenModelica/OMCompiler/build/lib/omlibrary/Buildings 7.0.0/Electrical/Transmission/Functions/selectCable_low.mo:19:3-23:30:writable] Error: assert triggered: In function Buildings.Electrical.Transmission.Functions.selectCable_low,
  cable autosizing has a nominal Voltage 15000 [V].
  The low voltage cables do not support such a voltage level.

I looked up selectCable_low in the library source code of Buldings.Electrical and found several places where it is invoked. I then looked up selectCable_med, but I could only find the definition of the function, which is apparently never called.

Could it be that there is something wrong with the library which eventually calls selectCable_low all the time even when commercialCable is redeclared to Buildings.Electrical.Transmission.MediumVoltageCables.Generic?

Change History (5)

comment:1 by Per Östlund, 4 years ago

Component: Third-Party LibrariesNew Instantiation
Owner: changed from Michael Wetter to Per Östlund
Status: newassigned

This is an issue in the NF. The call to selectCable_low is supposed to be overwritten by the redeclares, but the NF merges the modifiers incorrectly. I might have a fix on the way but need to do some more testing.

comment:2 by Per Östlund, 4 years ago

I've fixed this particular issue in PR #6720. This fixes the ACLineMedium model in the same package, but the ACSimpleGridMedium model now fails with a type mismatch error (the OF gives an equivalent error, but I'm certain it's a bug in the compiler). The ACSimpleGrid model also fails with the same error now even though it worked before, but it only worked before due to the incorrect modifier handling.

So I'm going to merge the fix even though it means we just trade one model for another, since it's at least more correct now.

comment:3 by Michael Wetter, 4 years ago

@casella: The models look correct to me. The function selectCable_med is not invoked because the examples are for medium voltage lines. I will however add a unit test so the function is used at least once in the library (through https://github.com/lbl-srg/modelica-buildings/issues/2095).

comment:4 by Francesco Casella, 4 years ago

Sorry for the misunderstanding. We really need a tool that shows the inheritance diagrams of Modelica packages, sometimes figuring out where stuff is declared from the source code is tricky.

comment:5 by Francesco Casella, 4 years ago

Milestone: 1.17.01.16.0
Resolution: fixed
Status: assignedclosed

Opened #6188 on the new specific issue.

Note: See TracTickets for help on using tickets.