Skip to content

Add missing replaceable.#1493

Merged
annadellisola merged 3 commits into
open-ideas:masterfrom
qlambert-pro:missing-replaceable
May 20, 2026
Merged

Add missing replaceable.#1493
annadellisola merged 3 commits into
open-ideas:masterfrom
qlambert-pro:missing-replaceable

Conversation

@qlambert-pro
Copy link
Copy Markdown
Contributor

IDEAS.Templates.Examples.RadiatorHeating extends IDEAS.Templates.Examples.IdealRadiatorHeating and redeclares heating.
Unfortunately, in IDEAS.Templates.Examples.IdealRadiatorHeating, heating is redeclared without the replaceable keyword.

This PR adds the missing keyword.

@annadellisola
Copy link
Copy Markdown
Contributor

IDEAS.Templates.Examples.RadiatorHeating extends IDEAS.Templates.Examples.IdealRadiatorHeating and redeclares heating. Unfortunately, in IDEAS.Templates.Examples.IdealRadiatorHeating, heating is redeclared without the replaceable keyword.

This PR adds the missing keyword.

The model IDEAS.Templates.Examples.IdealRadiatorHeating extends from IDEAS.Templates.Examples.BaseClasses.SimpleHeatingsystem where the heating model is already declared replaceable:

replaceable IDEAS.Templates.Heating.BaseClasses.HysteresisHeating heating
    constrainedby IDEAS.Templates.Interfaces.BaseClasses.HeatingSystem(
    final nZones=nZones,
    QNom={2000 for i in 1:nZones},
    Q_design=structure.Q_design);

Therefore the suggested change is not necessary.

@qlambert-pro
Copy link
Copy Markdown
Contributor Author

qlambert-pro commented May 19, 2026

Section 7.3.3 states:

Only classes and components declared as replaceable can be redeclared with a new type, which
must have an interface compatible with the constraining interface of the original declaration, and
to allow further redeclarations one must use redeclare replaceable.

And for whatever it is worth, we (Wolfram System Modeler) reject IDEAS.Templates.Examples.RadiatorHeating on that basis.

@annadellisola annadellisola reopened this May 19, 2026
Copy link
Copy Markdown
Contributor

@annadellisola annadellisola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qlambert-pro Thank you for addressing the issue.
Based on the Modelica guidelines, I have updated the model ‎IDEAS/Templates/Examples/IdealRadiatorHeating.

Comment thread IDEAS/Templates/Examples/IdealRadiatorHeating.mo Outdated
Comment thread IDEAS/Templates/Examples/IdealRadiatorHeating.mo Outdated
@annadellisola annadellisola merged commit 39e63b2 into open-ideas:master May 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants