AIT-IES / DisHeatLib

Modelica library for district heating network modelling using IBPSA library as core
Other
14 stars 7 forks source link

Support for OpenModelica #1

Open stianchris opened 4 years ago

stianchris commented 4 years ago

Hello,

I am new to Modelica and want to get into the DisHeatLib. Currently I'm working with OpenModelica 1.16.0 (operation system is Linux) and do not have access to Dymola. The errors seem to be not OM-specific to me, though (I hope!).

Version of the DisHeatLib used is 1.2.

While opening the example "OneSupplyOneBuilding", I get the following TranslationErrors:

[DisHeatLib.Demand.BaseClasses.BaseDemand: 19:7-21:46]: Variable Medium.cp_const konnte nicht im Geltungsbereich von BaseDemand gefunden werden.

It is due to the line 18 ff: protected final parameter Modelica.SIunits.SpecificHeatCapacity cp_default= Medium.cp_const "Specific heat capacity of the fluid";

I guess that a redeclaration of the Medium package is missing?

[DisHeatLib.Supply.BaseClasses.BaseSupply: 25:7-28:34]: Variable Medium.cp_const konnte nicht im Geltungsbereich von BaseSupply gefunden werden.

Same as above...

[DisHeatLib.Storage.BaseClasses.ThermostatMixer: 127:5-127:40]: Variable allowFlowReversal konnte nicht im Geltungsbereich von ThermostatMixer gefunden werden.

It is due to line 127: allowFlowReversal=allowFlowReversal,

The parameter allowFlowReversal is not declared above. I guess it is only these lines missing (taken from the StorageTank):

parameter Boolean allowFlowReversal = true "= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1" annotation(Dialog(tab="Assumptions"), Evaluate=true);

I am new to Modelica and thus not yet familiar on how to debug the library myself. If someone could show me a workflow for that, I would also be grateful!

Best regards and thanks for your development efforts(!),

Christian

benleit commented 3 years ago

Dear Christian,

Sorry for not coming back to you for so long. The short answer is that DisHeatLib is only tested / working with Dymola. The long answer is that DisHeatLib is based on the IBPSA library and OpenModelica does not fully cover all models of IBPSA (see https://libraries.openmodelica.org/branches/master/IBPSA_latest/IBPSA_latest.html for a summary). This is especially relevant for the model PlugFlowPipe used to model district heating pipes. Moreover, OpenModelica is (currently) not able to compete with Dymola when it comes to larger models (where even Dymola is already having troubles). Thus, I recommend using DisHeatLib only together with Dymola – sorry. I hope to be able to change this in the future.

Best regards, Benedikt

AGeissler commented 8 months ago

Hi there. Three years later, the issues seem to remain the same, even though PlugFlowPipe seems to be supported by Openmodelica in the IBPSA library version 3.0.0. Is there anything going on in the background, here? I would be interested. Thanks. Best, Achim