This model groups multiple zones by linking adjacent walls, floors and ceilings.
The factor ampFactor
controls the fluctuating amplitude
of internal heat gain in each zone.
model MultiZone
package MediumA =
Buildings.Media.Air ;
parameter Integer nZon(min=1) = 1 ;
parameter Integer nFlo(min=1) = 1 ;
parameter Real ampFactor[nZon]=
if nZon<=5
then
{
abs(
cos(i*3.1415926/(nZon)))
for i
in 1:nZon}
else
{
abs(
cos(i*3.1415926/5))
for i
in 1:nZon}
;
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b portsIn[nZon,nFlo](
redeclare each package Medium = MediumA) ;
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b portsOut[nZon,nFlo](
redeclare each package Medium = MediumA) ;
Modelica.Blocks.Interfaces.RealOutput TRooAir[nZon,nFlo](
each final unit="K",
each displayUnit="degC")
;
Modelica.Blocks.Interfaces.RealOutput EHea[nZon,nFlo](
each final unit="J")
;
Modelica.Blocks.Interfaces.RealOutput ECoo[nZon,nFlo](
each final unit="J")
;
Buildings.Examples.ScalableBenchmarks.BuildingVAV.ThermalZones.ThermalZone theZon[nZon,nFlo](
redeclare each package MediumA = MediumA,
gainFactor={{ampFactor[i]
for j
in 1:nFlo}
for i
in 1:nZon})
;
Buildings.BoundaryConditions.WeatherData.Bus weaBus ;
equation
for iZon
in 1:nZon-1
loop
for iFlo
in 1:nFlo-1
loop
connect(theZon[iZon, iFlo].heaPorFlo, theZon[iZon,
if iFlo == nFlo
then 1
else iFlo+1].heaPorCei);
connect(theZon[iZon, iFlo].heaPorWal1, theZon[
if iZon == nZon
then 1
else iZon+1, iFlo].heaPorWal2);
end for;
end for;
for iZon
in 1:nZon
loop
for iFlo
in 1:nFlo
loop
connect(weaBus, theZon[iZon, iFlo].weaBus);
connect(portsIn[iZon, iFlo], theZon[iZon, iFlo].portsInOut[1]);
connect(portsOut[iZon, iFlo], theZon[iZon, iFlo].portsInOut[2]);
end for;
end for;
connect(theZon.TRooAir, TRooAir);
connect(theZon.EHea, EHea);
connect(theZon.ECoo, ECoo);
end MultiZone;
model ThermalZone
replaceable package MediumA =
Modelica.Media.Interfaces.PartialMedium
;
parameter Real gainFactor(start=1) ;
parameter Real VInf_flow=(roo.AFlo*roo.hRoo)*0.5/3600 ;
final parameter Modelica.Units.SI.Angle S_=Buildings.Types.Azimuth.S
;
final parameter Modelica.Units.SI.Angle E_=Buildings.Types.Azimuth.E
;
final parameter Modelica.Units.SI.Angle W_=Buildings.Types.Azimuth.W
;
final parameter Modelica.Units.SI.Angle N_=Buildings.Types.Azimuth.N
;
final parameter Modelica.Units.SI.Angle C_=Buildings.Types.Tilt.Ceiling
;
final parameter Modelica.Units.SI.Angle F_=Buildings.Types.Tilt.Floor
;
final parameter Modelica.Units.SI.Angle Z_=Buildings.Types.Tilt.Wall
;
final parameter HeatTransfer.Data.Solids.Plywood matFur(x=0.15, nStaRef=5)
;
final parameter HeatTransfer.Data.Solids.Concrete matCon(
x=0.1,
k=1.311,
c=836,
nStaRef=5) ;
final parameter HeatTransfer.Data.Solids.Plywood matWoo(
x=0.01,
k=0.11,
d=544,
nStaRef=1) ;
final parameter HeatTransfer.Data.Solids.Generic matIns(
x=0.087,
k=0.049,
c=836.8,
d=265,
nStaRef=5) ;
final parameter HeatTransfer.Data.Solids.GypsumBoard matGyp(
x=0.0127,
k=0.16,
c=830,
d=784,
nStaRef=2) ;
final parameter HeatTransfer.Data.Solids.GypsumBoard matGyp2(
x=0.025,
k=0.16,
c=830,
d=784,
nStaRef=2) ;
final parameter HeatTransfer.Data.OpaqueConstructions.Generic conExtWal(
final nLay=3,
material={matWoo,matIns,matGyp}) ;
final parameter HeatTransfer.Data.OpaqueConstructions.Generic conIntWal(
final nLay=1,
material={matGyp2}) ;
final parameter HeatTransfer.Data.OpaqueConstructions.Generic conFlo(
final nLay=1,
material={matCon}) ;
final parameter HeatTransfer.Data.Solids.Plywood matCarTra(
k=0.11,
d=544,
nStaRef=1,
x=0.215/0.11) ;
final parameter HeatTransfer.Data.GlazingSystems.DoubleClearAir13Clear glaSys(
UFra=2,
shade=
Buildings.HeatTransfer.Data.Shades.Gray(),
haveInteriorShade=false,
haveExteriorShade=false) ;
Modelica.Blocks.Interfaces.RealOutput TRooAir(
final unit="K")
;
Modelica.Blocks.Interfaces.RealOutput EHea(
final unit="J")
;
Modelica.Blocks.Interfaces.RealOutput ECoo(
final unit="J")
;
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b portsInOut[2](
redeclare package Medium =
MediumA) ;
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPorWal1
;
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPorFlo
;
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b heaPorCei
;
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b heaPorWal2
;
Buildings.ThermalZones.Detailed.MixedAir roo(
redeclare package Medium =
MediumA,
hRoo=2.7,
nPorts=4,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
AFlo=6*8,
datConExtWin(
layers={conExtWal},
A={8*2.7},
glaSys={glaSys},
wWin={2*3},
hWin={2},
fFra={0.001},
til={Z_},
azi={S_}),
datConBou(
layers={conFlo, conIntWal},
A={6*8, 6*2.7},
til={F_, Z_}),
surBou(
A={6*8, 6*2.7},
til={C_, Z_},
absIR = {conFlo.absIR_a, conIntWal.absIR_a},
absSol = {conFlo.absSol_a, conIntWal.absSol_a}),
datConPar(
layers={conIntWal},
A={8*2.7/2},
til={Buildings.Types.Tilt.Wall}),
nConExt=0,
nConPar=1,
nSurBou=2,
nConBou=2,
nConExtWin=1)
;
Modelica.Blocks.Sources.Constant qConGai_flow(k=579/48) ;
Modelica.Blocks.Sources.Constant qRadGai_flow(k=689/48) ;
Modelica.Blocks.Sources.Constant qLatGai_flow(k=146.5/48) ;
Modelica.Blocks.Routing.Multiplex3 multiplex3_1 ;
Modelica.Blocks.Sources.Constant uSha(k=0)
;
Buildings.BoundaryConditions.WeatherData.Bus weaBus
;
Modelica.Blocks.Math.Product product1 ;
Modelica.Blocks.Math.Gain gain(k=gainFactor) ;
Modelica.Blocks.Math.Product product2 ;
Modelica.Blocks.Math.Gain gain1(k=gainFactor)
;
Modelica.Blocks.Math.Product product3 ;
Modelica.Blocks.Math.Gain gain2(k=gainFactor) ;
Modelica.Blocks.Math.Add powCal(k1=-1)
;
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor rooAirTem
;
Buildings.Examples.ScalableBenchmarks.BuildingVAV.BaseClasses.IntLoad intLoad(
table=[0,0.1;
((gainFactor - 0.5) + 8)*3600,1.0;
((gainFactor - 0.5) + 18)*3600,0.1;
24*3600,0.1]) ;
Fluid.Sources.MassFlowSource_WeatherData
souExf(
redeclare package Medium =
MediumA,
use_m_flow_in=false,
m_flow=-VInf_flow*1.2,
nPorts=1) ;
Fluid.Sources.MassFlowSource_WeatherData
souInf2(
redeclare package Medium =
MediumA,
use_m_flow_in=false,
m_flow=VInf_flow*1.2,
nPorts=1) ;
protected
Fluid.Sensors.EnthalpyFlowRate senEntFloSupAir(
redeclare package Medium =
MediumA, m_flow_nominal=0.2)
;
Fluid.Sensors.EnthalpyFlowRate senEntFloRetAir(
redeclare package Medium =
MediumA, m_flow_nominal=0.2)
;
Controls.OBC.CDL.Reals.Max PHea ;
Controls.OBC.CDL.Reals.Min PCoo ;
Controls.OBC.CDL.Reals.Sources.Constant con0(k=0)
;
Modelica.Blocks.Continuous.Integrator intEHea(initType=Modelica.Blocks.Types.Init.InitialState)
;
Modelica.Blocks.Continuous.Integrator intECoo(initType=Modelica.Blocks.Types.Init.InitialState)
;
equation
connect(multiplex3_1.y, roo.qGai_flow);
connect(roo.surf_conBou[1], heaPorFlo);
connect(roo.surf_conBou[2], heaPorWal1);
connect(roo.surf_surBou[1], heaPorCei);
connect(roo.surf_surBou[1], heaPorWal2);
connect(uSha.y, roo.uSha[1]);
connect(weaBus, roo.weaBus);
connect(qLatGai_flow.y, product3.u1);
connect(product3.y, gain2.u);
connect(product2.y, gain1.u);
connect(product1.y, gain.u);
connect(gain1.y, multiplex3_1.u2[1]);
connect(qConGai_flow.y, product2.u1);
connect(qRadGai_flow.y, product1.u1);
connect(gain.y, multiplex3_1.u1[1]);
connect(gain2.y, multiplex3_1.u3[1]);
connect(intLoad.y[1], product1.u2);
connect(product1.u2, product2.u2);
connect(product1.u2, product3.u2);
connect(rooAirTem.T, TRooAir);
connect(roo.heaPorAir, rooAirTem.port);
connect(portsInOut[1], senEntFloSupAir.port_a);
connect(senEntFloSupAir.port_b, roo.ports[1]);
connect(senEntFloRetAir.H_flow, powCal.u1);
connect(senEntFloSupAir.H_flow, powCal.u2);
connect(intEHea.y, EHea);
connect(ECoo, intECoo.y);
connect(intECoo.u, PCoo.y);
connect(PHea.y, intEHea.u);
connect(con0.y, PHea.u2);
connect(con0.y, PCoo.u1);
connect(PHea.u1, powCal.y);
connect(PCoo.u2, powCal.y);
connect(senEntFloRetAir.port_b, portsInOut[2]);
connect(senEntFloRetAir.port_a, roo.ports[2]);
connect(souInf2.ports[1], roo.ports[3]);
connect(souExf.ports[1], roo.ports[4]);
connect(souInf2.weaBus, weaBus);
connect(souExf.weaBus, weaBus);
end ThermalZone;