Buildings.ThermalZones.Detailed.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.ThermalZones.Detailed.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.ThermalZones.Detailed.Examples.ElectroChromicWindow ElectroChromicWindow Model that illustrates the use of electrochromic windows
Buildings.ThermalZones.Detailed.Examples.MixedAirCO2 MixedAirCO2 Mixed air room model with CO2 concentration simulated
Buildings.ThermalZones.Detailed.Examples.MixedAirFreeResponse MixedAirFreeResponse Free response of room model
Buildings.ThermalZones.Detailed.Examples.Controls Controls Package with control models
Buildings.ThermalZones.Detailed.Examples.FFD FFD Package that tests the models for coupled simulation between Modelica and Fast Fluid Dynamics

Buildings.ThermalZones.Detailed.Examples.ElectroChromicWindow Buildings.ThermalZones.Detailed.Examples.ElectroChromicWindow

Model that illustrates the use of electrochromic windows

Buildings.ThermalZones.Detailed.Examples.ElectroChromicWindow

Information

This model illustrates the use of an electrochromic window. It uses a model of the test cell 71T, room B at LBNL, and controls the window state based on room air temperature and solar irradiation.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
replaceable package MediumABuildings.Media.Air (T_defau...Medium model
AreaAFlo13.94Floor area [m2]
IntegernConExtWin1Number of constructions with a window
IntegernConExt0Number of constructions without a window
IntegernConBou5Number of surface that are connected to constructions that are modeled inside the room
IntegernSurBou0Number of surface that are connected to the room air volume
IntegernConPar0Number of surface that are partitions
GenericmatExtWalmatExtWal(nLay=3, absIR_a=0....71T: South Wall
GenericmatCeilmatCeil(nLay=3, absIR_a=0.9,...71T: Ceiling
GenericmatFlomatFlo(final nLay=4, absIR_a...71T: Floor
GenericmatEWWalmatEWWal(final nLay=2, absIR...71T: East West Wall
GenericmatNWalmatNWal(final nLay=4, absIR_...71T: North Wall
DoubleElectrochromicAir13ClearglaSysglaSys(UFra=2, haveInteriorS...Data record for the glazing system

Connectors

TypeNameDescription
replaceable package MediumAMedium model
BusweaBus 

Modelica definition

model ElectroChromicWindow "Model that illustrates the use of electrochromic windows" extends Modelica.Icons.Example; replaceable package MediumA = Buildings.Media.Air(T_default=T_start) "Medium model"; constant Modelica.SIunits.Temperature T_start=273.15 + 20 "Initial value"; parameter Modelica.SIunits.Area AFlo=13.94 "Floor area"; parameter Integer nConExtWin=1 "Number of constructions with a window"; parameter Integer nConExt=0 "Number of constructions without a window"; parameter Integer nConBou=5 "Number of surface that are connected to constructions that are modeled inside the room"; parameter Integer nSurBou=0 "Number of surface that are connected to the room air volume"; parameter Integer nConPar=0 "Number of surface that are partitions"; MixedAir roo( redeclare package Medium = MediumA, nConExt=nConExt, nConExtWin=nConExtWin, nConPar=nConPar, nConBou=nConBou, nSurBou=nSurBou, linearizeRadiation=false, T_start=T_start, datConExtWin( layers={matExtWal}, each A=10.22, glaSys={glaSys}, each hWin=3.13, each wWin=2.782751, each fFra=0.000001, each til=Buildings.Types.Tilt.Wall, azi={Buildings.Types.Azimuth.S}), datConBou( layers={matFlo,matCeil,matEWWal,matNWal,matEWWal}, A={13.94,13.94,15.33,10.22,15.33}, til={Buildings.Types.Tilt.Floor,Buildings.Types.Tilt.Ceiling,Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall,Buildings.Types.Tilt.Wall}), hRoo=3.37, intConMod=Buildings.HeatTransfer.Types.InteriorConvection.Temperature, extConMod=Buildings.HeatTransfer.Types.ExteriorConvection.TemperatureWind, conBou(opa(T(each start = T_start))), nPorts=2, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, lat=0.65484753534827, final AFlo=AFlo) "Room model"; BoundaryConditions.WeatherData.ReaderTMY3 weaDat1( relHum=0, TDewPoi(displayUnit="K"), filNam= Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"), pAtmSou=Buildings.BoundaryConditions.Types.DataSource.File, calTSky=Buildings.BoundaryConditions.Types.SkyTemperatureCalculation.HorizontalRadiation); Modelica.Blocks.Sources.Constant uSha(k=0) "Control signal for the shading device"; Modelica.Blocks.Routing.Replicator replicator(nout=max(1, nConExtWin)); parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic matExtWal( nLay=3, absIR_a=0.9, absIR_b=0.9, absSol_a=0.6, absSol_b=0.6, material={Buildings.HeatTransfer.Data.Solids.Generic( x=0.000701, k=45.345, c=502.416, d=7833.028),Buildings.HeatTransfer.Data.Solids.Generic( x=0.0127, k=0.12, c=1210, d=540),Buildings.HeatTransfer.Data.Solids.Generic( x=0.133, k=0.047, c=1006, d=93.84)}) "71T: South Wall"; parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic matCeil( nLay=3, absIR_a=0.9, absIR_b=0.9, absSol_a=0.6, absSol_b=0.6, material={Buildings.HeatTransfer.Data.Solids.Generic( x=0.009525, k=0.12, c=1210, d=540),Buildings.HeatTransfer.Data.Solids.Generic( x=0.133, k=0.047, c=1006, d=93.84),Buildings.HeatTransfer.Data.Solids.Generic( x=0.015875, k=0.17, c=1090, d=800)}) "71T: Ceiling"; parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic matFlo( final nLay=4, absIR_a=0.9, absIR_b=0.9, absSol_a=0.6, absSol_b=0.6, material={Buildings.HeatTransfer.Data.Solids.Generic( x=5.28, k=1, c=0, d=0),Buildings.HeatTransfer.Data.Solids.Generic( x=0.01905, k=0.15, c=1630, d=608),Buildings.HeatTransfer.Data.Solids.Generic( x=0.01905, k=0.12, c=1210, d=540),Buildings.HeatTransfer.Data.Solids.Generic( x=0.22, k=1, c=0, d=0)}) "71T: Floor"; parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic matEWWal( final nLay=2, absIR_a=0.9, absIR_b=0.9, absSol_a=0.6, absSol_b=0.6, material={Buildings.HeatTransfer.Data.Solids.Generic( x=0.133, k=0.047, c=1006, d=93.84),Buildings.HeatTransfer.Data.Solids.Generic( x=0.015875, k=0.17, c=1090, d=800)}) "71T: East West Wall"; parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic matNWal( final nLay=4, absIR_a=0.9, absIR_b=0.9, absSol_a=0.6, absSol_b=0.6, material={Buildings.HeatTransfer.Data.Solids.Generic( x=0.015875, k=0.17, c=1090, d=800),Buildings.HeatTransfer.Data.Solids.Generic( x=0.009525, k=0.12, c=1210, d=540),Buildings.HeatTransfer.Data.Solids.Generic( x=0.133, k=0.047, c=1006, d=93.84),Buildings.HeatTransfer.Data.Solids.Generic( x=0.015875, k=0.17, c=1090, d=800)}) "71T: North Wall"; parameter HeatTransfer.Data.GlazingSystems.DoubleElectrochromicAir13Clear glaSys( UFra=2, haveInteriorShade=false, haveExteriorShade=false) "Data record for the glazing system"; BoundaryConditions.WeatherData.Bus weaBus; Controls.ElectrochromicWindow conWin "Controller for windows"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRooAir "Room air temperature"; Fluid.Sources.MassFlowSource_T bou( redeclare package Medium = MediumA, m_flow=-47*6/3600*1.2, nPorts=1, T=293.15) "Boundary condition"; Fluid.Sources.Outside freshAir(redeclare package Medium = MediumA, nPorts=1) "Boundary condition"; Fluid.FixedResistances.PressureDrop duc( redeclare package Medium = MediumA, allowFlowReversal=false, linearized=true, from_dp=true, dp_nominal=100, m_flow_nominal=47*6/3600*1.2) "Duct resistance (to decouple room and outside pressure)"; Modelica.Blocks.Math.MatrixGain gai(K=120/AFlo*[0.4; 0.4; 0.2]) "Matrix gain to split up heat gain in radiant, convective and latent gain"; Modelica.Blocks.Sources.Pulse nPer( period(displayUnit="d") = 86400, startTime(displayUnit="h") = 25200, amplitude=2) "Number of persons"; equation connect(uSha.y, replicator.u); connect(roo.uSha, replicator.y); connect(weaBus, roo.weaBus); connect(weaBus, weaDat1.weaBus); connect(roo.heaPorAir, TRooAir.port); connect(TRooAir.T, conWin.T); connect(conWin.H, weaBus.HGloHor); connect(conWin.y, roo.uWin[1]); connect(freshAir.weaBus, weaBus); connect(freshAir.ports[1], duc.port_a); connect(bou.ports[1], roo.ports[1]); connect(duc.port_b, roo.ports[2]); connect(gai.u[1],nPer. y); connect(gai.y, roo.qGai_flow); end ElectroChromicWindow;

Buildings.ThermalZones.Detailed.Examples.MixedAirCO2 Buildings.ThermalZones.Detailed.Examples.MixedAirCO2

Mixed air room model with CO2 concentration simulated

Buildings.ThermalZones.Detailed.Examples.MixedAirCO2

Information

Example that demonstrates how to add CO2 emission that scales with the number of person, and then add a feedback control that increases the outside air mass flow rate.

The gain gaiCO2 adds a CO2 mass flow rate of 8.18E-6 kg/s per person to the room. It is scaled with the number of person, as obtained from the block nPer. In this example, the number of person are zero except for 2 hours, starting at 11 AM. During this time, 5 people are in the room.

The sensor senCO2 measures the CO2 PPM in the room. This is used by the controller conPI to adjust the outside air flow rate. Two gains are used to normalize the control input. This is simply done to make it easier to configure the gains of the controller. The block addFlo increases the outdoor air flow rate above the base flow rate, which is set to mOut_flow. Plotting the control error shows that the set point is being tracked after a brief overshoot during the initial transient.

Extends from Buildings.ThermalZones.Detailed.Examples.ElectroChromicWindow (Model that illustrates the use of electrochromic windows).

Parameters

TypeNameDefaultDescription
replaceable package MediumABuildings.Media.Air (extraPr...Medium model
AreaAFlo13.94Floor area [m2]
IntegernConExtWin1Number of constructions with a window
IntegernConExt0Number of constructions without a window
IntegernConBou5Number of surface that are connected to constructions that are modeled inside the room
IntegernSurBou0Number of surface that are connected to the room air volume
IntegernConPar0Number of surface that are partitions
GenericmatExtWal 71T: South Wall
GenericmatCeil 71T: Ceiling
GenericmatFlo 71T: Floor
GenericmatEWWal 71T: East West Wall
GenericmatNWal 71T: North Wall
DoubleElectrochromicAir13ClearglaSys Data record for the glazing system
MassFlowRatemOut_flow47*2/3600*1.2Typical outside air mass flow rate, unless increased by controller [kg/s]

Connectors

TypeNameDescription
replaceable package MediumAMedium model
BusweaBus 

Modelica definition

model MixedAirCO2 "Mixed air room model with CO2 concentration simulated" extends Buildings.ThermalZones.Detailed.Examples.ElectroChromicWindow( bou(use_m_flow_in=true), redeclare package MediumA = Buildings.Media.Air(extraPropertiesNames={"CO2"}), roo( use_C_flow=true, nPorts=3), nPer( width=100*2/24, amplitude=5, startTime=43200)); parameter Modelica.SIunits.MassFlowRate mOut_flow = 47*2/3600*1.2 "Typical outside air mass flow rate, unless increased by controller"; Modelica.Blocks.Math.Gain gaiCO2(k=8.18E-6) "CO2 emission per person"; Buildings.Fluid.Sensors.PPM senCO2( redeclare package Medium = MediumA, MM=Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM) "CO2 sensor that measures concentration in the room"; Modelica.Blocks.Sources.Constant CO2Set(k=700) "CO2 set point in PPM above the initial value"; Modelica.Blocks.Math.Gain norCO2Set(k=1/700) "Normalization for CO2 set point"; Modelica.Blocks.Math.Gain norCO2Mea(k=1/700) "Normalization for CO2 measurement"; Buildings.Controls.Continuous.LimPID conPI( k=5, Ti=120, yMax=10, yMin=0, reverseAction=true, controllerType=Modelica.Blocks.Types.SimpleController.PI) "PI controller for fresh air supply, with negative minimum because of reverse action"; Buildings.Controls.OBC.CDL.Continuous.AddParameter addFlo( p = -mOut_flow, k=-mOut_flow) "Gain that increases the mass flow rate above its typical value"; equation connect(roo.C_flow[1], gaiCO2.y); connect(nPer.y, gaiCO2.u); connect(senCO2.port, roo.ports[3]); connect(CO2Set.y, norCO2Set.u); connect(senCO2.ppm, norCO2Mea.u); connect(norCO2Set.y, conPI.u_s); connect(norCO2Mea.y, conPI.u_m); connect(conPI.y,addFlo. u); connect(addFlo.y, bou.m_flow_in); end MixedAirCO2;

Buildings.ThermalZones.Detailed.Examples.MixedAirFreeResponse Buildings.ThermalZones.Detailed.Examples.MixedAirFreeResponse

Free response of room model

Buildings.ThermalZones.Detailed.Examples.MixedAirFreeResponse

Information

This model illustrates the use of the room model Buildings.ThermalZones.Detailed.MixedAir.

The geometry, materials and constructions of the model are consistent with those of Buildings.Examples.VAVReheat.ThermalZones.Floor but here they are modelled as a single thermal zone. The model is representative for one floor of the new construction medium office building for Chicago, IL, as described in the set of DOE Commercial Building Benchmarks. There are four perimeter zones and one core zone. The envelope thermal properties meet ASHRAE Standard 90.1-2004.

For a comparison between the one-zone and five-zone model, see Buildings.ThermalZones.Detailed.Validation.SingleZoneFloorWithHeating.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
PlywoodmatWoomatWoo(x=0.01, k=0.11, d=544...Wood for exterior construction
ConcretematConmatCon(x=0.1, k=1.311, c=836...Concrete
GenericmatInsmatIns(x=0.087, k=0.049, c=8...Steelframe construction with insulation
GypsumBoardmatGypmatGyp(x=0.0127, k=0.16, c=8...Gypsum board
GypsumBoardmatGyp2matGyp2(x=0.025, k=0.16, c=8...Gypsum board
PlywoodmatFurmatFur(x=0.15, nStaRef=5)Material for furniture
PlywoodmatCarTramatCarTra(x=0.215/0.11, k=0....Wood for floor
CarpetmatCar Carpet
DoubleClearAir13ClearglaSysglaSys(UFra=2, shade=Buildin...Data record for the glazing system
GenericconExtWalconExtWal(final nLay=3, mate...Exterior construction
GenericconIntWalconIntWal(final nLay=1, mate...Interior wall construction
GenericconFloconFlo(final nLay=1, materia...Floor construction (opa_a is carpet)
GenericconFurconFur(final nLay=1, materia...Construction for internal mass of furniture
StringweaFilModelica.Utilities.Files.loa...Weather data file
AnglelatBuildings.BoundaryConditions...Latitude [rad]
VolumeVRoo4555.7Room volum [m3]
HeighthRoo2.74Room height [m]
LengthhWin1.5Height of windows [m]
RealwinWalRat0.33Window to wall ratio for exterior walls
AreaAFloVRoo/hRooFloor area [m2]

Modelica definition

model MixedAirFreeResponse "Free response of room model" extends Modelica.Icons.Example; package Medium = Buildings.Media.Air "Medium model"; parameter Buildings.HeatTransfer.Data.Solids.Plywood matWoo( x=0.01, k=0.11, d=544, nStaRef=1) "Wood for exterior construction"; parameter Buildings.HeatTransfer.Data.Solids.Concrete matCon( x=0.1, k=1.311, c=836, nStaRef=5) "Concrete"; parameter Buildings.HeatTransfer.Data.Solids.Generic matIns( x=0.087, k=0.049, c=836.8, d=265, nStaRef=5) "Steelframe construction with insulation"; parameter Buildings.HeatTransfer.Data.Solids.GypsumBoard matGyp( x=0.0127, k=0.16, c=830, d=784, nStaRef=2) "Gypsum board"; parameter Buildings.HeatTransfer.Data.Solids.GypsumBoard matGyp2( x=0.025, k=0.16, c=830, d=784, nStaRef=2) "Gypsum board"; parameter Buildings.HeatTransfer.Data.Solids.Plywood matFur(x=0.15, nStaRef=5) "Material for furniture"; parameter Buildings.HeatTransfer.Data.Solids.Plywood matCarTra( x=0.215/0.11, k=0.11, d=544, nStaRef=1) "Wood for floor"; parameter Buildings.HeatTransfer.Data.Resistances.Carpet matCar "Carpet"; parameter Buildings.HeatTransfer.Data.GlazingSystems.DoubleClearAir13Clear glaSys( UFra=2, shade=Buildings.HeatTransfer.Data.Shades.Gray(), haveInteriorShade=false, haveExteriorShade=false) "Data record for the glazing system"; parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic conExtWal( final nLay=3, material={matWoo,matIns,matGyp}) "Exterior construction"; parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic conIntWal( final nLay=1, material={matGyp2}) "Interior wall construction"; parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic conFlo( final nLay=1, material={matCon}) "Floor construction (opa_a is carpet)"; parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic conFur( final nLay=1, material={matFur}) "Construction for internal mass of furniture"; parameter String weaFil = Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos") "Weather data file"; parameter Modelica.SIunits.Angle lat = Buildings.BoundaryConditions.WeatherData.BaseClasses.getLatitudeTMY3(weaFil) "Latitude"; parameter Modelica.SIunits.Volume VRoo = 4555.7 "Room volum"; parameter Modelica.SIunits.Height hRoo = 2.74 "Room height"; parameter Modelica.SIunits.Length hWin = 1.5 "Height of windows"; parameter Real winWalRat(min=0.01,max=0.99) = 0.33 "Window to wall ratio for exterior walls"; parameter Modelica.SIunits.Area AFlo = VRoo/hRoo "Floor area"; Buildings.ThermalZones.Detailed.MixedAir roo( redeclare package Medium = Medium, lat=lat, AFlo=AFlo, hRoo=hRoo, nConExt=0, nConExtWin=4, datConExtWin( layers={conExtWal,conExtWal,conExtWal,conExtWal}, A={ 49.91*hRoo, 49.91*hRoo, 33.27*hRoo, 33.27*hRoo}, glaSys={glaSys,glaSys,glaSys,glaSys}, wWin={ winWalRat/hWin*49.91*hRoo, winWalRat/hWin*49.91*hRoo, winWalRat/hWin*33.27*hRoo, winWalRat/hWin*33.27*hRoo}, each hWin=hWin, fFra={0.1, 0.1, 0.1, 0.1}, til={Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall}, azi={Buildings.Types.Azimuth.N, Buildings.Types.Azimuth.S, Buildings.Types.Azimuth.W, Buildings.Types.Azimuth.E}), nConPar=3, datConPar( layers={conFlo, conFur, conIntWal}, A={AFlo, AFlo*2, (6.47*2 + 40.76 + 24.13)*2*hRoo}, til={Buildings.Types.Tilt.Floor, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall}), nConBou=0, nSurBou=0, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Floor"; Modelica.Blocks.Sources.Constant qConGai_flow(k=0) "Convective heat gain"; Modelica.Blocks.Sources.Constant qRadGai_flow(k=0) "Radiative heat gain"; Modelica.Blocks.Routing.Multiplex3 multiplex3_1 "Multiplex"; Modelica.Blocks.Sources.Constant qLatGai_flow(k=0) "Latent heat gain"; Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat( filNam=weaFil, computeWetBulbTemperature=false); Modelica.Blocks.Sources.Constant uSha(k=0) "Control signal for the shading device"; Modelica.Blocks.Routing.Replicator replicator(nout=4); equation connect(qRadGai_flow.y, multiplex3_1.u1[1]); connect(qConGai_flow.y, multiplex3_1.u2[1]); connect(qLatGai_flow.y, multiplex3_1.u3[1]); connect(multiplex3_1.y, roo.qGai_flow); connect(weaDat.weaBus, roo.weaBus); connect(uSha.y, replicator.u); connect(roo.uSha, replicator.y); end MixedAirFreeResponse;