lbl-srg / obc

OpenBuildingControl - Performance Evaluation, Specification, Deployment and Verification of Building Control Sequences
http://obc.lbl.gov
26 stars 14 forks source link

Simplify BoilerPlant.Submodels.BoilerPlantControls.SetPoints.MinimumFlowSetPoint #122

Open mwetter opened 2 years ago

mwetter commented 2 years ago

The controller BoilerPlant.Submodels.BoilerPlantControls.SetPoints.MinimumFlowSetPoint uses the following construct:

image

This can likely be done more efficient (and clearer) with a switch or a maybe a switch and a pre block. The current implementation integrates 0 and adds the reset value, which seems overly complex.

@karthikeyad-pnnl: Can you please refactor it and make a PR. This is from commit 0e00d31ed75f6568058865c9b3047ae36e547fdf, branch issue92_caseStudyFullHVAC

karthikeyad-pnnl commented 2 years ago

@mwetter : I will look into the suggested alternatives. I know that the Modelica language has an in-built pre function, but do we have a CDL implementation of the pre block for Real variables? Or do we only have it for Boolean variables?

mwetter commented 2 years ago

In CDL, we only have Logical.Pre. We didn't expect to need it for Real (and Integer), but maybe we do need it?