Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new output connector to thermalZones and post processing #1221

Merged
merged 7 commits into from
Mar 24, 2022
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
within AixLib.ThermalZones.ReducedOrder.Multizone.BaseClasses;
within AixLib.ThermalZones.ReducedOrder.Multizone.BaseClasses;
model MultizonePostProcessing
"Calculates and outputs values of interest for multizone model"
parameter Modelica.SIunits.Volume VAir
Expand Down Expand Up @@ -169,6 +169,22 @@ model MultizonePostProcessing
VAir) if calc_rel_humidity
"Average relative humidity of all zones"
annotation (Placement(transformation(extent={{58,48},{74,64}})));
Modelica.Blocks.Interfaces.RealOutput QIntGains[numZones,3](
final quantity="Energy",
final unit="J",
displayUnit="kWh")
"Heat gains based on internal gains for each zone from persons, machines, and light"
annotation (Placement(transformation(extent={{100,-122},{120,-102}}),
iconTransformation(extent={{100,-130},{120,-110}})));
Modelica.Blocks.Interfaces.RealInput QIntGains_flow[numZones,3](final
quantity="HeatFlowRate", final unit="W")
"Heat flow based on internal gains for each zone from persons, machines, and light"
annotation (
Placement(transformation(extent={{-140,-140},{-100,-100}}),
iconTransformation(extent={{-140,-140},{-100,-100}})));
Modelica.Blocks.Continuous.Integrator QIntGainCalc[numZones,3]
"Heat gain based on internal gains for each zone from persons, machines, and light"
annotation (Placement(transformation(extent={{58,-124},{74,-108}})));
equation
connect(TAirAverageCalc.u, TAir) annotation (Line(points={{56.4,96},{56.4,100},
{-120,100}}, color={0,0,127}));
Expand Down Expand Up @@ -237,9 +253,14 @@ equation
{15.5,42},{15.5,56},{56.4,56}}, color={0,0,127}));
connect(RelHumditiyMeanCalc.y, RelHumidityMean) annotation (Line(points={{74.8,56},
{88,56},{88,60},{110,60}}, color={0,0,127}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
connect(QIntGains_flow, QIntGainCalc.u) annotation (Line(points={{-120,-120},
{-32,-120},{-32,-116},{56.4,-116}}, color={0,0,127}));
connect(QIntGainCalc.y, QIntGains) annotation (Line(points={{74.8,-116},{92,
-116},{92,-112},{110,-112}}, color={0,0,127}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-120},{100,100}}), graphics={
Rectangle(
extent={{-100,100},{100,-100}},
extent={{-100,100},{100,-120}},
lineColor={28,108,200},
fillColor={255,255,255},
fillPattern=FillPattern.Solid),
Expand Down Expand Up @@ -279,7 +300,8 @@ equation
Ellipse(extent={{2,-64},{10,-70}}, lineColor={28,108,200}),
Ellipse(extent={{12,-54},{20,-60}}, lineColor={28,108,200})}),
Diagram(
coordinateSystem(preserveAspectRatio=false)),
coordinateSystem(preserveAspectRatio=false, extent={{-100,-120},{100,
100}})),
Documentation(info="<html><p>
This model is used to simplify the post processing. It's purpose is
to calculate and output common simulation information and KPI for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,22 @@ partial model PartialMultizone "Partial model for multizone models"
annotation (
Placement(transformation(extent={{100,-70},{120,-50}}),iconTransformation(
extent={{80,-100},{100,-80}})));
Modelica.Blocks.Interfaces.RealOutput QIntGains_flow[numZones,3](final
quantity="HeatFlowRate", final unit="W") if ASurTot > 0 or VAir > 0
"Heat flow based on internal gains for each zone from persons, machines, and light"
annotation (Placement(transformation(extent={{100,-90},{
120,-70}}), iconTransformation(extent={{80,-100},{100,-80}})));
equation
// if ASurTot or VAir < 0 PHeater and PCooler are set to dummy value zero
if not (ASurTot > 0 or VAir > 0) then
PHeater[:] = fill(0, numZones);
PCooler[:] = fill(0, numZones);
else
for i in 1:numZones loop
connect(zone[i].QIntGains_flow, QIntGains_flow[i, :]);
end for;
end if;

// if ideal heating and/or cooling is set by seperate values
if (ASurTot > 0 or VAir > 0) and not recOrSep then
if Heater_on then
Expand Down
45 changes: 36 additions & 9 deletions AixLib/ThermalZones/ReducedOrder/ThermalZone/ThermalZone.mo
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,20 @@ model ThermalZone "Thermal zone containing moisture balance"
"Mass fraction of co2 in ROM in kg_CO2/ kg_TotalAir"
annotation (Placement(transformation(extent={{-8,-74},{10,-60}})));

BoundaryConditions.SolarIrradiation.DiffusePerez HDifTilRoof[zoneParam.nOrientationsRoof](
each final outSkyCon=false,
each final outGroCon=false,
each final lat=zoneParam.lat,
final azi=zoneParam.aziRoof,
final til=zoneParam.tiltRoof)
"Calculates diffuse solar radiation on titled surface for roof"
annotation (Placement(transformation(extent={{-84,61},{-68,77}})));
Modelica.Blocks.Interfaces.RealOutput QIntGains_flow[3](each final quantity="HeatFlowRate",
each final unit="W") if ATot > 0
"Heat flow based on internal gains from persons, machines, and light"
annotation (
Placement(transformation(extent={{100,-50},{120,-30}}),
iconTransformation(extent={{100,-50},{120,-30}})));
// protected: ThermalZone
protected
Modelica.Blocks.Sources.Constant hConRoof(final k=(zoneParam.hConRoofOut + zoneParam.hRadRoof)*zoneParam.ARoof)
Expand Down Expand Up @@ -382,15 +396,22 @@ protected
(ATot > 0 or zoneParam.VAir > 0) and use_moisture_balance
annotation (Placement(transformation(extent={{-70,-58},{-60,-42}})));

public
BoundaryConditions.SolarIrradiation.DiffusePerez HDifTilRoof[zoneParam.nOrientationsRoof](
each final outSkyCon=false,
each final outGroCon=false,
each final lat=zoneParam.lat,
final azi=zoneParam.aziRoof,
final til=zoneParam.tiltRoof)
"Calculates diffuse solar radiation on titled surface for roof"
annotation (Placement(transformation(extent={{-84,61},{-68,77}})));
// protected: Outputs
Modelica.Blocks.Sources.RealExpression QIntGainsInternalDep_flow[3](y={-lights.convHeat.Q_flow
- lights.radHeat.Q_flow,-machinesSenHea.radHeat.Q_flow -
machinesSenHea.convHeat.Q_flow, -humanSenHeaDependent.radHeat.Q_flow -
humanSenHeaDependent.convHeat.Q_flow}) if ATot > 0 and internalGainsMode == 1
annotation (Placement(transformation(extent={{94,-46},{98,-34}})));
Modelica.Blocks.Sources.RealExpression QIntGainsInternalInd_flow[3](y={-lights.convHeat.Q_flow
- lights.radHeat.Q_flow,-machinesSenHea.radHeat.Q_flow -
machinesSenHea.convHeat.Q_flow, -humanSenHeaIndependent.radHeat.Q_flow -
humanSenHeaIndependent.convHeat.Q_flow}) if ATot > 0 and internalGainsMode == 2
annotation (Placement(transformation(extent={{94,-46},{98,-34}})));
Modelica.Blocks.Sources.RealExpression QIntGainsInternalTot_flow[3](y={-lights.convHeat.Q_flow
- lights.radHeat.Q_flow,-machinesSenHea.radHeat.Q_flow -
machinesSenHea.convHeat.Q_flow, -humanTotHeaDependent.radHeat.Q_flow -
humanTotHeaDependent.convHeat.Q_flow}) if ATot > 0 and internalGainsMode == 3
annotation (Placement(transformation(extent={{94,-46},{98,-34}})));
Utilities.Psychrometrics.MixedHumidity mixedHumidity if (ATot > 0 or
zoneParam.VAir > 0) and use_AirExchange and use_moisture_balance
"Mixes humidity of infiltration flow and mechanical ventilation flow"
Expand Down Expand Up @@ -721,6 +742,12 @@ equation
index=-1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(QIntGainsInternalDep_flow.y, QIntGains_flow) annotation (Line(points={{98.2,
-40},{110,-40}}, color={0,0,127}));
connect(QIntGainsInternalInd_flow.y, QIntGains_flow) annotation (Line(points={{98.2,
-40},{110,-40}}, color={0,0,127}));
connect(QIntGainsInternalTot_flow.y, QIntGains_flow) annotation (Line(points={{98.2,
-40},{110,-40}}, color={0,0,127}));
annotation (Documentation(revisions="<html><ul>
<li>November 20, 2020, by Katharina Breuer:<br/>
Combine thermal zone models
Expand Down