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.
model ElectroChromicWindow
extends Modelica.Icons.Example;
package MediumA =
Buildings.Media.Air(T_default=T_start) ;
constant Modelica.SIunits.Temperature T_start=273.15 + 20 ;
parameter Integer nConExtWin=1 ;
parameter Integer nConExt=0 ;
parameter Integer nConBou=5 ;
parameter Integer nSurBou=0 ;
parameter Integer nConPar=0 ;
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}),
AFlo=13.94,
hRoo=3.37,
intConMod=Buildings.HeatTransfer.Types.InteriorConvection.Temperature,
extConMod=Buildings.HeatTransfer.Types.ExteriorConvection.TemperatureWind,
each conBou(opa(T(
each start = T_start))),
nPorts=2,
lat=0.65484753534827,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
BoundaryConditions.WeatherData.ReaderTMY3 weaDat1(
relHum=0,
TDewPoi(displayUnit="K"),
filNam=
"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) ;
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)}) ;
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)}) ;
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)}) ;
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)}) ;
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)}) ;
parameter HeatTransfer.Data.GlazingSystems.DoubleElectrochromicAir13Clear glaSys(
UFra=2,
haveInteriorShade=false,
haveExteriorShade=false) ;
BoundaryConditions.WeatherData.Bus weaBus;
Modelica.Blocks.Routing.Multiplex3 multiplex3_1;
Modelica.Blocks.Sources.Constant qRadGai_flow(k=0) ;
Modelica.Blocks.Sources.Constant qConGai_flow(k=0) ;
Modelica.Blocks.Sources.Constant qLatGai_flow(k=0) ;
block Infiltration
extends Modelica.Blocks.Icons.Block;
parameter Modelica.SIunits.VolumeFlowRate V_flow ;
parameter Real A ;
parameter Real B(unit="1/K") ;
parameter Real C(unit="s/m") ;
BoundaryConditions.WeatherData.Bus weaBus;
Modelica.Blocks.Interfaces.RealOutput m_flow ;
Modelica.Blocks.Interfaces.RealInput TRoo(unit="K") ;
Modelica.Blocks.Math.Add dT(k2=-1) ;
Modelica.Blocks.Math.Product m ;
Modelica.Blocks.Sources.Constant V(k=V_flow) ;
Utilities.Psychrometrics.Density_pTX rho ;
Utilities.Psychrometrics.X_pTphi x_pTphiValidation( use_p_in=true);
Modelica.Blocks.Math.Abs dTAbs ;
Modelica.Blocks.Sources.Constant ACoef(k=A) ;
Modelica.Blocks.Math.Gain gainB(k=B) ;
Modelica.Blocks.Math.Gain gainC(k=C) ;
Modelica.Blocks.Math.Add3 add3_1;
Modelica.Blocks.Math.Product mAct_flow ;
Modelica.Blocks.Math.Gain ter(k=(270/10)^0.14*((3.35/2)/370)^0.22) ;
equation
connect(m.u1, V.y);
connect(rho.T, weaBus.TDryBul);
connect(x_pTphi.p_in, weaBus.pAtm);
connect(x_pTphi.T, weaBus.TDryBul);
connect(x_pTphi.phi, weaBus.relHum);
connect(rho.X_w, x_pTphi.X[1]);
connect(rho.p, weaBus.pAtm);
connect(rho.d, m.u2);
connect(dT.u1, TRoo);
connect(dT.u2, weaBus.TDryBul);
connect(dT.y, dTAbs.u);
connect(gainB.u, dTAbs.y);
connect(add3_1.u1, ACoef.y);
connect(add3_1.u2, gainB.y);
connect(add3_1.u3, gainC.y);
connect(mAct_flow.y, m_flow);
connect(add3_1.y, mAct_flow.u2);
connect(m.y, mAct_flow.u1);
connect(ter.y, gainC.u);
connect(ter.u, weaBus.winSpe);
end Infiltration;
Controls.ElectrochromicWindow conWin;
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRooAir ;
Fluid.Sources.MassFlowSource_T
boundary(
redeclare package Medium = MediumA,
m_flow=-47*6/3600*1.2,
T=293.15,
nPorts=1) ;
Fluid.Sources.Outside freshAir(
redeclare package Medium = MediumA, nPorts=1) ;
Fluid.FixedResistances.FixedResistanceDpM duc(
redeclare package Medium = MediumA,
allowFlowReversal=false,
linearized=true,
from_dp=true,
dp_nominal=100,
m_flow_nominal=47*6/3600*1.2) ;
equation
connect(uSha.y, replicator.u);
connect(roo.uSha, replicator.y);
connect(weaBus, roo.weaBus);
connect(weaBus, weaDat1.weaBus);
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(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(boundary.ports[1], roo.ports[1]);
connect(duc.port_b, roo.ports[2]);
end ElectroChromicWindow;
model MixedAirFreeResponse
extends Modelica.Icons.Example;
package MediumA =
Buildings.Media.Air ;
parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Insulation100Concrete200
matLayExt ;
parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Brick120 matLayPar ;
parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic matLayRoo(
material={
HeatTransfer.Data.Solids.InsulationBoard(x=0.2),
HeatTransfer.Data.Solids.Concrete(x=0.2)},
final nLay=2) ;
parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic matLayFlo(
material={
HeatTransfer.Data.Solids.Concrete(x=0.2),
HeatTransfer.Data.Solids.InsulationBoard(x=0.15),
HeatTransfer.Data.Solids.Concrete(x=0.05)},
final nLay=3) ;
parameter Buildings.HeatTransfer.Data.GlazingSystems.DoubleClearAir13Clear glaSys(
UFra=2,
shade=
Buildings.HeatTransfer.Data.Shades.Gray(),
haveInteriorShade=false,
haveExteriorShade=false) ;
parameter Integer nConExtWin = 1 ;
parameter Integer nConBou = 1 ;
parameter Integer nSurBou = 1 ;
Buildings.Rooms.MixedAir roo(
redeclare package Medium = MediumA,
AFlo=6*4,
hRoo=2.7,
nConExt=2,
datConExt(layers={matLayRoo, matLayExt},
A={6*4, 6*3},
til={Buildings.Types.Tilt.Ceiling, Buildings.Types.Tilt.Wall},
azi={Buildings.Types.Azimuth.S, Buildings.Types.Azimuth.W}),
nConExtWin=nConExtWin,
datConExtWin(
layers={matLayExt},
each A=4*3,
glaSys={glaSys},
each hWin=2,
each wWin=4,
ove(wR={0},wL={0}, gap={0.1}, dep={1}),
each fFra=0.1,
each til=Buildings.Types.Tilt.Wall,
azi={Buildings.Types.Azimuth.S}),
nConPar=1,
datConPar(layers={matLayPar},
each A=10,
each til=Buildings.Types.Tilt.Wall),
nConBou=1,
datConBou(layers={matLayFlo},
each A=6*4,
each til=Buildings.Types.Tilt.Floor),
nSurBou=1,
surBou(
each A=6*3,
each absIR=0.9,
each absSol=0.9,
each til=Buildings.Types.Tilt.Wall),
linearizeRadiation = false,
nPorts=1,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
lat=0.73268921998722,
T_start=273.15+22) ;
Modelica.Blocks.Sources.Constant qConGai_flow(k=0) ;
Modelica.Blocks.Sources.Constant qRadGai_flow(k=0) ;
Modelica.Blocks.Routing.Multiplex3 multiplex3_1;
Modelica.Blocks.Sources.Constant qLatGai_flow(k=0) ;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
filNam="modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos");
Modelica.Blocks.Sources.Constant uSha(k=0) ;
Modelica.Blocks.Routing.Replicator replicator(nout=
max(1,nConExtWin));
Buildings.HeatTransfer.Sources.FixedTemperature TSoi[nConBou](
each T = 283.15) ;
Buildings.HeatTransfer.Sources.FixedTemperature TBou[nSurBou](
each T=288.15) ;
HeatTransfer.Conduction.MultiLayer conOut[nSurBou](
each A=6*4,
each layers=matLayPar,
each steadyStateInitial=true) ;
Fluid.Sources.FixedBoundary boundary(
nPorts=1,
redeclare package Medium = MediumA,
T=293.15) ;
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(TSoi.port, roo.surf_conBou);
connect(TBou.port,conOut. port_b);
connect(roo.surf_surBou, conOut.port_a);
connect(roo.uSha, replicator.y);
connect(roo.ports[1], boundary.ports[1]);
end MixedAirFreeResponse;