Skip to content

Commit

Permalink
Merge pull request #93 from ibpsa/issue49_signalExchangeUpdate
Browse files Browse the repository at this point in the history
Implements the fourth task in #49.
  • Loading branch information
dhblum committed Jul 31, 2019
2 parents 73630d3 + 5fceb52 commit 9e9e50f
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 40 deletions.
17 changes: 8 additions & 9 deletions parsing/SimpleRC.mo
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,32 @@ model SimpleRC
startTime=3600*24)
annotation (Placement(transformation(extent={{-100,-30},{-80,-10}})));
IBPSA.Utilities.IO.SignalExchange.Overwrite
oveSet( Description=
"Zone temperature setpoint", u(
oveSet( u(
unit="K",
min=273.15 + 10,
max=273.15 + 35))
max=273.15 + 35), description="Zone temperature setpoint")
annotation (Placement(transformation(extent={{-70,-30},{-50,-10}})));
IBPSA.Utilities.IO.SignalExchange.Overwrite
oveAct( Description=
"Heater thermal power", u(
oveAct(
u(
unit="W",
min=0,
max=3000))
max=3000), description="Heater thermal power")
annotation (Placement(transformation(extent={{-10,-30},{10,-10}})));
IBPSA.Utilities.IO.SignalExchange.Read
TZone(
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.AirZoneTemperature,
y(unit="K"),
Description="Zone temperature")
description="Zone temperature")
annotation (Placement(transformation(extent={{100,10},{120,30}})));
IBPSA.Utilities.IO.SignalExchange.Read
PHeat(
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.GasPower,
y(unit="W"),
Description="Heater electrical power")
description="Heater electrical power")
annotation (Placement(transformation(extent={{100,-90},{120,-70}})));
IBPSA.Utilities.IO.SignalExchange.Read
setZone(y(unit="K"), Description=
setZone(y(unit="K"), description=
"Zone temperature setpoint")
annotation (Placement(transformation(extent={{-40,-70},{-20,-50}})));
equation
Expand Down
4 changes: 2 additions & 2 deletions parsing/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ def parse_instances(model_path, file_name):
if 'boptestOverwrite' in var:
label = 'Overwrite'
unit = fmu.get_variable_unit(instance+'.u')
description = fmu.get(instance+'.Description')[0]
description = fmu.get(instance+'.description')[0]
mini = fmu.get_variable_min(instance+'.u')
maxi = fmu.get_variable_max(instance+'.u')
# Read
elif 'boptestRead' in var:
label = 'Read'
unit = fmu.get_variable_unit(instance+'.y')
description = fmu.get(instance+'.Description')[0]
description = fmu.get(instance+'.description')[0]
mini = None
maxi = None
# KPI
Expand Down
16 changes: 9 additions & 7 deletions testcase1/models/SimpleRC.mo
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ model SimpleRC
yMax=100000) "Feedback controller for the heater based on room temperature"
annotation (Placement(transformation(extent={{-70,-40},{-50,-20}})));
IBPSA.Utilities.IO.SignalExchange.Overwrite
oveAct( Description=
"Heater thermal power", u(
oveAct(
u(
unit="W",
min=0,
max=10000)) "Overwrite the heating power"
max=10000), description="Heater thermal power")
"Overwrite the heating power"
annotation (Placement(transformation(extent={{-40,-40},{-20,-20}})));
Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHeat
"Set the heating power to the room"
Expand All @@ -43,13 +44,14 @@ model SimpleRC
annotation (Placement(transformation(extent={{0,-90},{20,-70}})));
IBPSA.Utilities.IO.SignalExchange.Read
TRooAir( y(unit="K"),
Description="Zone air temperature",
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.AirZoneTemperature)
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.AirZoneTemperature,
description="Zone air temperature")
"Read the room air temperature"
annotation (Placement(transformation(extent={{80,-60},{60,-40}})));
IBPSA.Utilities.IO.SignalExchange.Read
PHea(y(unit="W"), Description="Heater power",
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.GasPower)
PHea(y(unit="W"),
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.GasPower,
description="Heater power")
"Read the heater power"
annotation (Placement(transformation(extent={{30,-90},{50,-70}})));
equation
Expand Down
45 changes: 24 additions & 21 deletions testcase2/models/SingleZoneVAV.mo
Original file line number Diff line number Diff line change
Expand Up @@ -63,49 +63,52 @@ package SingleZoneVAV
+ 273.15]) "Cooling setpoint for room temperature"
annotation (Placement(transformation(extent={{-180,-20},{-160,0}})));
IBPSA.Utilities.IO.SignalExchange.Overwrite
oveTSetRooHea( Description=
"Heating setpoint", u(
oveTSetRooHea(
u(
unit="K",
min=273.15 + 10,
max=273.15 + 35))
max=273.15 + 35), description="Heating setpoint")
annotation (Placement(transformation(extent={{-140,20},{-120,40}})));
IBPSA.Utilities.IO.SignalExchange.Overwrite
oveTSetRooCoo( Description=
"Cooling setpoint", u(
oveTSetRooCoo(
u(
unit="K",
min=273.15 + 10,
max=273.15 + 35))
max=273.15 + 35), description="Cooling setpoint")
annotation (Placement(transformation(extent={{-140,-20},{-120,0}})));
IBPSA.Utilities.IO.SignalExchange.Read
PPum(y(unit="W"), Description="Pump electrical power",
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.ElectricPower)
PPum(y(unit="W"),
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.ElectricPower,
description="Pump electrical power")
annotation (Placement(transformation(extent={{120,70},{140,90}})));
IBPSA.Utilities.IO.SignalExchange.Read
PCoo(y(unit="W"), Description=
"Cooling electrical power",
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.ElectricPower)
PCoo(y(unit="W"),
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.ElectricPower,
description="Cooling electrical power")
annotation (Placement(transformation(extent={{140,90},{160,110}})));
IBPSA.Utilities.IO.SignalExchange.Read
PHea(y(unit="W"), Description="Heater power",
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.ElectricPower)
PHea(y(unit="W"),
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.ElectricPower,
description="Heater power")
annotation (Placement(transformation(extent={{120,110},{140,130}})));
IBPSA.Utilities.IO.SignalExchange.Read
PFan(y(unit="W"), Description="Fan electrical power",
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.ElectricPower)
PFan(y(unit="W"),
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.ElectricPower,
description="Fan electrical power")
annotation (Placement(transformation(extent={{140,130},{160,150}})));
IBPSA.Utilities.IO.SignalExchange.Read TRooAir( y(unit="K"),
Description="Room air temperature",
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.AirZoneTemperature)
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.AirZoneTemperature,
description="Room air temperature")
annotation (Placement(transformation(extent={{120,-10},{140,10}})));
IBPSA.Utilities.IO.SignalExchange.Read senTSetRooCoo(
y(unit="K"),
Description="Room cooling setpoint",
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.None)
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.None,
description="Room cooling setpoint")
annotation (Placement(transformation(extent={{-100,-80},{-80,-60}})));
IBPSA.Utilities.IO.SignalExchange.Read senTSetRooHea(
y(unit="K"),
Description="Room heating setpoint",
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.None)
KPIs=IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.None,
description="Room heating setpoint")
annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
equation
connect(weaDat.weaBus, weaBus) annotation (Line(
Expand Down
2 changes: 1 addition & 1 deletion testing/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WORKDIR $HOME

RUN git clone https://github.com/ibpsa/modelica-ibpsa.git $HOME/git/ibpsa/modelica-ibpsa && \
git clone https://github.com/lbl-srg/modelica-buildings.git $HOME/git/buildings/modelica-buildings && \
cd $HOME/git/ibpsa/modelica-ibpsa && git checkout 03de076 && \
cd $HOME/git/ibpsa/modelica-ibpsa && git checkout 9e1f57c && \
cd $HOME/git/buildings/modelica-buildings && git checkout 1a6d3a768cf43f43b4e434997653734f85f722d8

RUN python -m pip install --user pandas==0.22.0 requests
Expand Down

0 comments on commit 9e9e50f

Please sign in to comment.