Buildings.Utilities.IO.BCVTB.Examples

Collection of models that illustrate model use and test models

Information


This package contains examples for the use of models
that can be found in 
Buildings.Utilities.IO.BCVTB.

Extends from Buildings.BaseClasses.BaseIconExamples (Icon for Examples packages).

Package Content

NameDescription
TwoRooms Thermal model of two rooms that will be linked to Ptolemy which models the controls


Buildings.Utilities.IO.BCVTB.Examples.TwoRooms

Thermal model of two rooms that will be linked to Ptolemy which models the controls

Buildings.Utilities.IO.BCVTB.Examples.TwoRooms

Information


This example illustrates the use of Modelica with the Building Controls Virtual Test Bed.
Given a control signal for two heat flow rates, Modelica simulates the thermal response 
of two first order systems. The two systems may represent a first order approximation of a room.
The control signal for the heat flow rate is computed in the Building Controls Virtual Test Bed
using a discrete time implementation of a proportional controller.
This model is implemented in bcvtb\examples\roomPtDymola.
Every 60 seconds, measured temperatures and control signals for the heat flow rates are
exchanged between Dymola and the Building Controls Virtual Test Bed.


Parameters

TypeNameDefaultDescription
Timetau2*3600Room time constant [s]
HeatFlowRateQ_flow_nom100Nominal heat flow [W]
ThermalConductanceUAQ_flow_nom/20Thermal conductance of room [W/K]

Modelica definition

model TwoRooms 
  "Thermal model of two rooms that will be linked to Ptolemy which models the controls"
  import Buildings;
  parameter Modelica.SIunits.Time tau = 2*3600 "Room time constant";
  parameter Modelica.SIunits.HeatFlowRate Q_flow_nom = 100 "Nominal heat flow";
  parameter Modelica.SIunits.ThermalConductance UA = Q_flow_nom / 20 
    "Thermal conductance of room";
  Modelica.Thermal.HeatTransfer.Components.HeatCapacitor C1(C=tau*UA, T(start=
          283.15)) "Heat capacity of room";
  Modelica.Thermal.HeatTransfer.Components.ThermalConductor UA1(G=UA) 
    "Heat transmission of room";
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TOut1(T=278.15) 
    "Outside air temperature";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow Q_flow_1 
    "Heat input into the room";
  Modelica.Blocks.Math.Gain GaiQ_flow_nom1(k=Q_flow_nom) 
    "Gain for nominal heat load";
  Modelica.Thermal.HeatTransfer.Components.ThermalConductor UA2(G=UA) 
    "Heat transmission of room";
  Modelica.Thermal.HeatTransfer.Components.HeatCapacitor C2(C=2*tau*UA, T(start=
         283.15)) "Heat capacity of room";
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TOut2(T=278.15) 
    "Outside air temperature";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow Q_flow_2 
    "Heat input into the room";
  Modelica.Blocks.Math.Gain GaiQ_flow_nom2(k=Q_flow_nom) 
    "Gain for nominal heat load";
  Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRoo1 
    "Room temperature";
  Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRoo2 
    "Room temperature";
  Buildings.Utilities.IO.BCVTB.BCVTB bcvtb(
    samplePeriod=60,
    nDblWri=2,
    nDblRea=2,
    xmlFileName=
        "P:\\bcvtb\\task1-supVis\\code\\bcvtb\\trunk\\bcvtb\\examples\\roomPtDymola\\socket.cfg");
  Modelica.Blocks.Routing.Multiplex2 multiplex2_1;
  Modelica.Blocks.Routing.DeMultiplex2 deMultiplex2_1;
  Modelica.Blocks.Math.Add add;
  Modelica.Blocks.Math.Add add1;
  Modelica.Blocks.Sources.Constant uniCon(k=-273.15) "Unit conversion";
equation 
  connect(TOut1.port, UA1.port_a);
  connect(UA1.port_b, C1.port);
  connect(TOut2.port, UA2.port_a);
  connect(UA2.port_b, C2.port);
  connect(Q_flow_1.port, C1.port);
  connect(Q_flow_2.port, C2.port);
  connect(C1.port, TRoo1.port);
  connect(C2.port, TRoo2.port);
  connect(GaiQ_flow_nom1.y, Q_flow_1.Q_flow);
  connect(GaiQ_flow_nom2.y, Q_flow_2.Q_flow);
  connect(bcvtb.yR, deMultiplex2_1.u);
  connect(deMultiplex2_1.y1[1], GaiQ_flow_nom1.u);
  connect(deMultiplex2_1.y2[1], GaiQ_flow_nom2.u);
  connect(multiplex2_1.y, bcvtb.uR);
  connect(uniCon.y, add.u2);
  connect(uniCon.y, add1.u1);
  connect(TRoo1.T, add.u1);
  connect(TRoo2.T, add1.u2);
  connect(add1.y, multiplex2_1.u2[1]);
  connect(add.y, multiplex2_1.u1[1]);
end TwoRooms;

HTML-documentation generated by Dymola Fri May 15 10:15:40 2009.