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 Modelica.SIunits.Angle lat=41.98*3.14159/180 ;
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] ;
Modelica.Blocks.Interfaces.RealOutput heaCooPow[nZon, nFlo] ;
Buildings.Examples.ScalableBenchmarks.BuildingVAV.ThermalZones.ThermalZone
theZon[nZon, nFlo](
redeclare each package MediumA = MediumA,
each final lat=lat,
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]);
connect(theZon[iZon, iFlo].heaCooPow, heaCooPow[iZon, iFlo]);
connect(theZon[iZon, iFlo].TRooAir, TRooAir[iZon, iFlo]);
end for;
end for;
end MultiZone;
model ThermalZone
replaceable package MediumA =
Modelica.Media.Interfaces.PartialMedium ;
parameter Modelica.SIunits.Angle lat ;
parameter Real gainFactor(start=1) ;
parameter Real VInf_flow=(roo.AFlo*roo.hRoo)*0.5/3600 ;
final parameter Modelica.SIunits.Angle S_=Buildings.Types.Azimuth.S ;
final parameter Modelica.SIunits.Angle E_=Buildings.Types.Azimuth.E ;
final parameter Modelica.SIunits.Angle W_=Buildings.Types.Azimuth.W ;
final parameter Modelica.SIunits.Angle N_=Buildings.Types.Azimuth.N ;
final parameter Modelica.SIunits.Angle C_=Buildings.Types.Tilt.Ceiling ;
final parameter Modelica.SIunits.Angle F_=Buildings.Types.Tilt.Floor ;
final parameter Modelica.SIunits.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 ;
Modelica.Blocks.Interfaces.RealOutput heaCooPow ;
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b portsInOut[2](
redeclare package Medium =
MediumA) ;
Buildings.Fluid.Sensors.TemperatureTwoPort supAirTem(
redeclare package Medium =
MediumA,
m_flow_nominal=1,
tau=0) ;
Buildings.Fluid.Sensors.TemperatureTwoPort retAirTem(
redeclare package Medium =
MediumA,
m_flow_nominal=1,
tau=0) ;
Buildings.Fluid.Sensors.MassFlowRate supplyAirFlow(
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,
lat=lat) ;
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.Fluid.Sources.Outside sinInf(
redeclare package Medium =
MediumA,
nPorts=1) ;
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.Sources.RealExpression powCal(y=supplyAirFlow.m_flow*1005*(
supAirTem.T - TRooAir)) ;
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_T souInf(
redeclare package Medium =
MediumA,
nPorts=1,
use_m_flow_in=false,
m_flow=-VInf_flow*1.2) ;
Fluid.FixedResistances.PressureDrop res(
redeclare package Medium =
MediumA,
m_flow_nominal=VInf_flow*1.2,
dp_nominal=20,
linearized=true) ;
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(sinInf.weaBus, 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(souInf.ports[1], roo.ports[1]);
connect(sinInf.ports[1], res.port_a);
connect(res.port_b, roo.ports[2]);
connect(supAirTem.port_a, supplyAirFlow.port_b);
connect(portsInOut[1], supplyAirFlow.port_a);
connect(portsInOut[2], retAirTem.port_b);
connect(rooAirTem.T, TRooAir);
connect(powCal.y, heaCooPow);
connect(supAirTem.port_b, roo.ports[3]);
connect(retAirTem.port_a, roo.ports[4]);
connect(roo.heaPorAir, rooAirTem.port);
end ThermalZone;