Skip to content

Commit

Permalink
implementation of interzonal air flow for #769
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathadon committed Oct 11, 2018
1 parent 0f951b7 commit b164815
Show file tree
Hide file tree
Showing 32 changed files with 850 additions and 306 deletions.
85 changes: 83 additions & 2 deletions IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ partial model PartialSimInfoManager
parameter Real ppmCO2 = 400
"Default CO2 concentration in [ppm] when using air medium containing CO2"
annotation(Dialog(tab="Advanced", group="CO2"));
parameter Boolean computeInterzonalAirFlow=false
annotation(Dialog(tab="Interzonal airflow"));

parameter Modelica.SIunits.Temperature TZone = 273.15+22
"Nominal zone air temperature for stack effect computations"
annotation (Dialog(tab="Interzonal airflow"),enable=computeInterzonalAirFlow);
parameter Modelica.SIunits.Pressure pAbs = 101300
"Nominal absolute pressure for stack effect computations"
annotation (Dialog(tab="Interzonal airflow"),enable=computeInterzonalAirFlow);
parameter Real n50=0.4
"n50 value cfr airtightness, i.e. the ACH at a pressure diffence of 50 Pa"
annotation (Dialog(tab="Interzonal airflow"),enable=computeInterzonalAirFlow);
parameter Real n50toAch=20 "Conversion fractor from n50 to Air Change Rate"
annotation(Dialog(tab="Interzonal airflow"));
parameter Real k_facade(fixed=false)
"Air leakage coefficient per unit of facade surface area";

final parameter Integer numIncAndAziInBus = size(incAndAziInBus,1)
"Number of pre-computed azimuth";
final parameter Modelica.SIunits.Temperature Tdes=-8 + 273.15
Expand Down Expand Up @@ -160,9 +177,23 @@ partial model PartialSimInfoManager
extent={{-20,-19},{20,19}},
rotation=270,
origin={99,3.55271e-015})));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a portFacSur if computeInterzonalAirFlow
"Port for computing total facade surface area"
annotation (Placement(transformation(extent={{56,-110},{76,-90}})));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a portVol if computeInterzonalAirFlow
"Port for computing total volume of building"
annotation (Placement(transformation(extent={{86,-110},{106,-90}})));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a portVent if computeInterzonalAirFlow
"Port for computing pressure"
annotation (Placement(transformation(extent={{26,-110},{46,-90}})));

protected
final parameter Integer yr=2014 "depcited year for DST only";
Modelica.Blocks.Interfaces.RealOutput AFacTot
"Total facade surface area";
Modelica.Blocks.Interfaces.RealOutput VTot
"Total facade surface area";

IDEAS.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
filNam=filNam)
annotation (Placement(transformation(extent={{-100,-60},{-80,-40}})));
Expand Down Expand Up @@ -202,10 +233,49 @@ protected
Modelica.Blocks.Routing.RealPassThrough HDifHor
"Diffuse solar irradiation on a horizontal plane"
annotation (Placement(transformation(extent={{-86,94},{-78,102}})));

Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTem(T=273.15) if computeInterzonalAirFlow
"Dummy sink for computing total surface area of building facade"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={66,-58})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTem1(
T=273.15) if computeInterzonalAirFlow
"Dummy sink for computing total volume of building"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={96,-58})));
Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor ATotSensor if computeInterzonalAirFlow annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=90,
origin={66,-82})));
Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor VTotSensor if computeInterzonalAirFlow annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=90,
origin={96,-82})));
Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlow(Q_flow=0,
alpha=0) if computeInterzonalAirFlow annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={36,-72})));
initial equation
Etot = 0;
if computeInterzonalAirFlow then
k_facade=n50*VTot/3600/AFacTot/sqrt(50);
else
k_facade=0;
end if;

equation
connect(AFacTot, ATotSensor.Q_flow);
connect(VTot, VTotSensor.Q_flow);
if not computeInterzonalAirFlow then
AFacTot=1 "To avoid division by zero";
VTot=1;
end if;
if strictConservationOfEnergy and computeConservationOfEnergy then
assert(abs(Etot) < Emax, "Conservation of energy violation > Emax J!");
end if;
Expand All @@ -217,7 +287,18 @@ equation
end if;
Etot = Qint - E.E;
E.Etot = Etot;

connect(VTotSensor.port_b,fixTem1. port)
annotation (Line(points={{96,-72},{96,-68}}, color={191,0,0}));
connect(VTotSensor.port_a,portVol)
annotation (Line(points={{96,-92},{96,-100}}, color={191,0,0}));
connect(ATotSensor.port_b,ATotSensor. port_b)
annotation (Line(points={{66,-72},{66,-72}}, color={191,0,0}));
connect(portFacSur,ATotSensor. port_a)
annotation (Line(points={{66,-100},{66,-92}}, color={191,0,0}));
connect(ATotSensor.port_b,fixTem. port)
annotation (Line(points={{66,-72},{66,-68}}, color={191,0,0}));
connect(fixedHeatFlow.port,portVent)
annotation (Line(points={{36,-82},{36,-100}}, color={191,0,0}));
connect(skyClearness.skyCle, skyBrightnessCoefficients.skyCle) annotation (
Line(
points={{-39,110},{-36,110},{-36,96},{-2,96}},
Expand Down
58 changes: 58 additions & 0 deletions IDEAS/Buildings/Components/BaseClasses/LeakageModel.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
within IDEAS.Buildings.Components.BaseClasses;
model LeakageModel "Model for zone air leakage"
replaceable package Medium = SolarwindBES.Media.Air constrainedby
Modelica.Media.Interfaces.PartialMedium;

parameter Modelica.SIunits.Area AFac(min=1) "Facade surface area for air leakage";

IDEAS.Fluid.FixedResistances.PressureDrop res(
redeclare package Medium = Medium,
final from_dp=true,
dp_nominal=1,
deltaM=0.01,
m_flow_nominal=AFac*sim.k_facade) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={30,0})));
outer IDEAS.BoundaryConditions.SimInfoManager sim
"Simulation information manager for climate data"
annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
Fluid.Sources.Outside_CpLowRise out(
redeclare package Medium = Medium,
nPorts=1,
use_C_in=Medium.nC == 1,
azi=azi,
s=1) "Boundary model"
annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=90,
origin={10,30})));
Modelica.Fluid.Interfaces.FluidPort_a port_lea(redeclare package Medium =
Medium) "Port for air leakage towards surroundings"
annotation (Placement(transformation(extent={{90,-10},{110,10}})));

parameter SI.Angle azi "Surface azimuth (South:0, West:pi/2)";
protected
IDEAS.Buildings.Components.Interfaces.WeaBus weaBus(numSolBus=sim.numIncAndAziInBus,
outputAngles=sim.outputAngles)
annotation (Placement(transformation(extent={{-50,82},{-30,102}})));

equation
connect(out.C_in[1],weaBus. CEnv)
annotation (Line(points={{18,42},{18,46},{62,46},{62,92},{10,92},{10,92.05},
{-39.95,92.05}}, color={0,0,127}));
connect(sim.weaBus,weaBus) annotation (Line(
points={{-81,93},{-40,93},{-40,92}},
color={255,204,51},
thickness=0.5));
connect(res.port_a,out. ports[1])
annotation (Line(points={{20,0},{10,0},{10,20}}, color={0,127,255}));
connect(res.port_b, port_lea)
annotation (Line(points={{40,0},{100,0}}, color={0,127,255}));
connect(out.weaBus, sim.weaDatBus) annotation (Line(
points={{9.8,40},{10,40},{10,60},{-80.1,60},{-80.1,90}},
color={255,204,51},
thickness=0.5));
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
coordinateSystem(preserveAspectRatio=false)));
end LeakageModel;
3 changes: 2 additions & 1 deletion IDEAS/Buildings/Components/BaseClasses/package.order
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ConductiveHeatTransfer
ConservationOfEnergy
ConvectiveHeatTransfer
ConservationOfEnergy
LeakageModel
RadiativeHeatTransfer
Varia
31 changes: 29 additions & 2 deletions IDEAS/Buildings/Components/Interfaces/DummyConnection.mo
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
within IDEAS.Buildings.Components.Interfaces;
model DummyConnection "Source generator/sink for propsbus"
replaceable package Medium = IDEAS.Media.Air "Air medium package";
parameter Boolean isZone = false "Set to true when connecting to a surface";
parameter Real A=1 "Surface area"
annotation(Dialog(enable=not isZone));
Expand All @@ -18,7 +19,8 @@ model DummyConnection "Source generator/sink for propsbus"
annotation (Placement(transformation(extent={{-100,20},{-80,40}})));
IDEAS.Buildings.Components.Interfaces.ZoneBus zoneBus(
outputAngles=sim.outputAngles,
numIncAndAziInBus=sim.numIncAndAziInBus)
numIncAndAziInBus=sim.numIncAndAziInBus,
redeclare package Medium = Medium)
annotation (Placement(transformation(extent={{80,-22},{120,18}})));
Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow prescribedHeatFlow[3](
Q_flow={surfCon,iSolDif,iSolDir}) if
Expand Down Expand Up @@ -46,7 +48,24 @@ model DummyConnection "Source generator/sink for propsbus"
annotation (Placement(transformation(extent={{-40,-50},{-20,-30}})));
Modelica.Blocks.Sources.Constant zero(k=0) if not isZone
annotation (Placement(transformation(extent={{-80,-50},{-60,-30}})));
IDEAS.Fluid.Sources.MassFlowSource_h bouInf1(redeclare package Medium =
Medium, nPorts=1) if
not isZone
annotation (Placement(transformation(extent={{-40,40},{-20,60}})));
IDEAS.Fluid.Sources.MassFlowSource_h bouItz1(redeclare package Medium =
Medium, nPorts=1) if
not isZone
annotation (Placement(transformation(extent={{-40,20},{-20,40}})));
Fluid.Sources.Boundary_pT bouInf2(
nPorts=1,
redeclare package Medium = Medium) if isZone
annotation (Placement(transformation(extent={{-40,80},{-20,100}})));
Fluid.Sources.Boundary_pT bouItz2(
nPorts=1,
redeclare package Medium = Medium) if isZone
annotation (Placement(transformation(extent={{-40,60},{-20,80}})));
equation
assert(not sim.computeInterzonalAirFlow, "Interzonal air flow not supported when using DummyConnection.");
connect(prescribedHeatFlow[1].port, zoneBus.surfCon) annotation (Line(
points={{-50,20},{62,20},{62,-1.9},{100.1,-1.9}},
color={191,0,0},
Expand Down Expand Up @@ -85,7 +104,7 @@ equation
smooth=Smooth.None));
if isZone then
connect(sim.weaBus, zoneBus.weaBus) annotation (Line(
points={{-84,32.8},{-40,32.8},{-40,-1.9},{100.1,-1.9}},
points={{-81,33},{-40,33},{-40,-1.9},{100.1,-1.9}},
color={255,204,51},
thickness=0.5));
end if;
Expand Down Expand Up @@ -114,6 +133,14 @@ equation
connect(sim.Qgai, zoneBus.Qgai) annotation (Line(points={{-90,20},{-90,20},{
-90,-1.9},{100.1,-1.9}}, color={0,0,0}));
end if;
connect(bouItz1.ports[1], zoneBus.itz) annotation (Line(points={{-20,30},{100.1,
30},{100.1,-1.9}}, color={0,127,255}));
connect(bouInf1.ports[1], zoneBus.inf) annotation (Line(points={{-20,50},{100.1,
50},{100.1,-1.9}}, color={0,127,255}));
connect(bouInf2.ports[1], zoneBus.inf) annotation (Line(points={{-20,90},{100.1,
90},{100.1,-1.9}}, color={0,127,255}));
connect(bouItz2.ports[1], zoneBus.itz) annotation (Line(points={{-20,70},{100.1,
70},{100.1,-1.9}}, color={0,127,255}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}})), Icon(coordinateSystem(
preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={
Expand Down
56 changes: 48 additions & 8 deletions IDEAS/Buildings/Components/Interfaces/PartialSurface.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ partial model PartialSurface "Partial model for building envelope component"
outer IDEAS.BoundaryConditions.SimInfoManager sim
"Simulation information manager for climate data"
annotation (Placement(transformation(extent={{30,-100},{50,-80}})));

replaceable package Medium = IDEAS.Media.Air "Air medium";
parameter Modelica.SIunits.Angle inc
"Inclination (tilt) angle of the wall, see IDEAS.Types.Tilt";
parameter Modelica.SIunits.Angle azi
Expand All @@ -31,10 +31,16 @@ partial model PartialSurface "Partial model for building envelope component"
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial
"Static (steady state) or transient (dynamic) thermal conduction model"
annotation(Evaluate=true, Dialog(tab = "Dynamics", group="Equations"));
parameter Boolean use_defaultItzBou = true
"= false, to disable the use of the default interzonal air exchange pressure boundary"
annotation(Dialog(tab="Advanced", group="Interzonal air exchange"));
parameter Boolean use_defaultInfBou = true
"= false, to disable the use of the default infiltration pressure boundary"
annotation(Dialog(tab="Advanced", group="Interzonal air exchange"));

IDEAS.Buildings.Components.Interfaces.ZoneBus propsBus_a(
numIncAndAziInBus=sim.numIncAndAziInBus, outputAngles=sim.outputAngles)
"If inc = Floor, then propsbus_a should be connected to the zone above this floor.
numIncAndAziInBus=sim.numIncAndAziInBus, outputAngles=sim.outputAngles,
redeclare package Medium = Medium) "If inc = Floor, then propsbus_a should be connected to the zone above this floor.
If inc = ceiling, then propsbus_a should be connected to the zone below this ceiling.
If component is an outerWall, porpsBus_a should be connect to the zone."
annotation (Placement(transformation(
Expand Down Expand Up @@ -75,13 +81,35 @@ protected
"Heat gains across model boundary";
Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlowQgai
"Component for computing conservation of energy";
Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow prescribedHeatFlowA(Q_flow=0,alpha=0) if sim.computeInterzonalAirFlow
"Component for adding facade surface area";
IDEAS.Fluid.Sources.MassFlowSource_T bouItz_a(
nPorts=1,
redeclare package Medium = Medium,
final m_flow=0) if use_defaultItzBou
"Default boundary for interzonal air flow rate" annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={50,50})));

IDEAS.Buildings.Components.Interfaces.ZoneBusVarMultiplicator gain(k=nWin)
IDEAS.Fluid.Sources.MassFlowSource_T bouInf_a(
nPorts=1,
redeclare package Medium = Medium,
final m_flow=0) if use_defaultInfBou
"Default boundary for air infiltration" annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={70,50})));
IDEAS.Buildings.Components.Interfaces.ZoneBusVarMultiplicator gain(k=nWin,
redeclare package Medium = Medium) if not nWin==1
"Gain for all propsBus variable to represent nWin surfaces instead of 1"
annotation (Placement(transformation(extent={{70,6},{88,36}})));
annotation (Placement(transformation(extent={{68,4},{86,34}})));
IDEAS.Buildings.Components.Interfaces.ZoneBus propsBusInt(
numIncAndAziInBus=sim.numIncAndAziInBus,
outputAngles=sim.outputAngles)
outputAngles=sim.outputAngles,
redeclare package Medium = Medium)
annotation (Placement(transformation(
extent={{-18,-18},{18,18}},
rotation=-90,
Expand All @@ -90,6 +118,7 @@ protected
rotation=-90,
origin={50,20})));
equation
connect(prescribedHeatFlowA.port,sim.portFacSur);
connect(prescribedHeatFlowE.port, propsBusInt.E);
connect(Qgai.y,prescribedHeatFlowQgai. Q_flow);
connect(prescribedHeatFlowQgai.port, propsBusInt.Qgai);
Expand Down Expand Up @@ -129,16 +158,27 @@ equation
string="%second",
index=1,
extent={{6,3},{6,3}}));
connect(bouItz_a.ports[1], propsBusInt.itz) annotation (Line(points={{50,40},{
50,20},{56.09,20},{56.09,19.91}},
color={0,127,255}));
connect(bouInf_a.ports[1], propsBusInt.inf) annotation (Line(points={{70,40},{
70,19.91},{56.09,19.91}}, color={0,127,255}));
connect(incExp.y, propsBusInt.inc);
connect(aziExp.y, propsBusInt.azi);
connect(propsBus_a, gain.propsBus_b) annotation (Line(
points={{100,20},{94,20},{94,20.2105},{88,20.2105}},
points={{100,20},{94,20},{94,19.7143},{86,19.7143}},
color={255,204,51},
thickness=0.5));
connect(gain.propsBus_a, propsBusInt) annotation (Line(
points={{70,20.2105},{60,20.2105},{60,20},{56,20}},
points={{68,19.7143},{60,19.7143},{60,20},{56,20}},
color={255,204,51},
thickness=0.5));
if nWin ==1 then
connect(propsBusInt, propsBus_a) annotation (Line(
points={{56,20},{56,0},{100,0},{100,20}},
color={255,204,51},
thickness=0.5));
end if;
annotation (
Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{
100,100}})),
Expand Down
Loading

0 comments on commit b164815

Please sign in to comment.