DLR-SR / ThermofluidStream

The DLR Thermofluid Stream Library
BSD 3-Clause "New" or "Revised" License
65 stars 27 forks source link

Several models in ThermoFluidStream appear to have parameters without binding and without explicitly set start value #180

Closed casella closed 7 months ago

casella commented 7 months ago

MLS 3.5 Section 8.6 states:

If a parameter has a modifier for the start attribute, does not have fixed = false, and neither has a binding equation nor is part of a record having a binding equation, the modifier for the start attribute can be used to add a parameter binding equation assigning the parameter to that start value. In this case a diagnostic message is recommended in a simulation model.

So if the unbound parameter doesn't have an explicit modifier for the start attribute, the model is invalid. This rule is enforced strictly in OMC 1.23.0 since we fixed OpenModelica/OpenModelica#10386. Other tools are more lenient, but I believe accepting parameters without bindings and explicitly set default values to be zero is really not a good idea.

If you check the latest OMC report, there are 10 models failing in the frontend, all for the similar reasons:

[/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermofluidStream 1.1.0-main/FlowControl/BasicControlValve.mo:22:3-23:88:writable]
Error: Parameter controlValve.Cvs_US has neither value nor start value, and is fixed during initialization (fixed=true).

If you want those parameters to get a value of zero (with a warning, as mandated by the MLS), please add an explicit modifier start = 0 to their declarations. We are going to release 1.23.0 in a few weeks, so it would be nice to have a patch release of your library by then.

Thanks!

tobolar commented 7 months ago

IMO similarity to #171

Probably cause due to parameters Kvs, Cvs_US and Cvs_UK in ThermofluidStream/FlowControl/BasicControlValve.mo ff.

casella commented 7 months ago

Sorry, I forgot I had already opened #171...