Skip to content

Commit 0e572bc

Browse files
committed
add missing connections for case where only mechnaical ventilation is active [skip ci] #1122
1 parent cbb5488 commit 0e572bc

File tree

1 file changed

+53
-44
lines changed

1 file changed

+53
-44
lines changed

AixLib/ThermalZones/ReducedOrder/ThermalZone/ThermalZone.mo

+53-44
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
within AixLib.ThermalZones.ReducedOrder.ThermalZone;
22
model ThermalZone "Thermal zone containing moisture balance"
3-
extends AixLib.ThermalZones.ReducedOrder.ThermalZone.BaseClasses.PartialThermalZone;
3+
extends
4+
AixLib.ThermalZones.ReducedOrder.ThermalZone.BaseClasses.PartialThermalZone;
45

56
replaceable model corG = SolarGain.CorrectionGDoublePane
67
constrainedby
@@ -234,13 +235,13 @@ model ThermalZone "Thermal zone containing moisture balance"
234235
final quantity="ThermodynamicTemperature",
235236
final unit="K",
236237
displayUnit="degC",
237-
min=0) if (ATot > 0 or zoneParam.VAir > 0) and use_AirExchange
238+
min=0) if (ATot > 0 or zoneParam.VAir > 0) and use_MechanicalAirExchange
238239
"Ventilation and infiltration temperature"
239240
annotation (Placement(
240241
transformation(extent={{-128,-60},{-88,-20}}), iconTransformation(
241242
extent={{-106,-26},{-86,-6}})));
242243
Modelica.Blocks.Interfaces.RealInput ventRate(final quantity="VolumeFlowRate",
243-
final unit="1/h") if (ATot > 0 or zoneParam.VAir > 0) and use_AirExchange
244+
final unit="1/h") if (ATot > 0 or zoneParam.VAir > 0) and use_MechanicalAirExchange
244245
"Ventilation and infiltration rate"
245246
annotation (
246247
Placement(transformation(
@@ -253,10 +254,10 @@ model ThermalZone "Thermal zone containing moisture balance"
253254

254255
// Moisture
255256
Modelica.Blocks.Math.MultiSum SumQLat1_flow(nu=2) if (ATot > 0 or
256-
zoneParam.VAir > 0) and use_moisture_balance and not use_AirExchange
257+
zoneParam.VAir > 0) and use_moisture_balance and not (use_NaturalAirExchange or use_MechanicalAirExchange)
257258
annotation (Placement(transformation(extent={{-40,-68},{-28,-56}})));
258259
Modelica.Blocks.Math.MultiSum SumQLat2_flow(nu=3) if (ATot > 0 or
259-
zoneParam.VAir > 0) and use_moisture_balance and use_AirExchange
260+
zoneParam.VAir > 0) and use_moisture_balance and (use_NaturalAirExchange or use_MechanicalAirExchange)
260261
annotation (Placement(transformation(extent={{-40,-68},{-28,-56}})));
261262
BoundaryConditions.InternalGains.Moisture.MoistureGains moistureGains(
262263
final roomArea=zoneParam.AZone,
@@ -276,7 +277,7 @@ model ThermalZone "Thermal zone containing moisture balance"
276277
Modelica.Blocks.Interfaces.RealInput ventHum(
277278
final quantity="MassFraction",
278279
final unit="kg/kg",
279-
min=0) if (ATot > 0 or zoneParam.VAir > 0) and use_moisture_balance and use_AirExchange
280+
min=0) if (ATot > 0 or zoneParam.VAir > 0) and use_moisture_balance and use_MechanicalAirExchange
280281
"Ventilation and infiltration humidity" annotation (Placement(
281282
transformation(extent={{-128,-108},{-88,-68}}), iconTransformation(
282283
extent={{-106,-82},{-84,-60}})));
@@ -369,16 +370,16 @@ protected
369370
"Combines infiltration and ventilation"
370371
annotation (Placement(
371372
transformation(
372-
extent={{-6,-6},{6,6}},
373+
extent={{-5,-5},{5,5}},
373374
rotation=0,
374-
origin={-34,-28})));
375+
origin={-35,-27})));
375376
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature preTemVen if (ATot >
376-
0 or zoneParam.VAir > 0) and (use_MechanicalAirExchange or use_AirExchange)
377+
0 or zoneParam.VAir > 0) and (use_MechanicalAirExchange or use_NaturalAirExchange)
377378
"Prescribed temperature for ventilation"
378379
annotation (Placement(transformation(
379-
extent={{-4,-4},{4,4}},
380+
extent={{-3,-3},{3,3}},
380381
rotation=0,
381-
origin={-36,0})));
382+
origin={-35,1})));
382383

383384
// protected: MoistAir
384385
Modelica.Blocks.Sources.RealExpression humVolAirROM(y=ROM.volMoiAir.X_w) if
@@ -400,8 +401,7 @@ public
400401
"Mixes humidity of infiltration flow and mechanical ventilation flow"
401402
annotation (Placement(transformation(extent={{-56,-10},{-48,-2}})));
402403
Utilities.Psychrometrics.X_pTphi x_pTphi if (ATot > 0 or zoneParam.VAir > 0)
403-
and use_NaturalAirExchange and use_MechanicalAirExchange and
404-
use_moisture_balance
404+
and use_NaturalAirExchange and use_moisture_balance
405405
annotation (Placement(transformation(extent={{-70,-12},{-64,-6}})));
406406
equation
407407
connect(intGains[2], machinesSenHea.uRel) annotation (Line(points={{80,-100},{
@@ -562,9 +562,6 @@ equation
562562
connect(heaterCoolerController.coolerActive, heaterCooler.coolerActive)
563563
annotation (Line(points={{76.38,16.4},{76.38,16},{66,16},{66,26},{65.3,26},{
564564
65.3,28.8}}, color={255,0,255}));
565-
connect(TSetHeat, heaterCooler.setPointHeat) annotation (Line(points={{-108,-16},
566-
{-86,-16},{-86,6},{74,6},{74,18},{75.42,18},{75.42,28.8}}, color={0,0,
567-
127}));
568565
connect(TSetCool, heaterCooler.setPointCool) annotation (Line(points={{-108,8},
569566
{70,8},{70,16},{70.36,16},{70.36,28.8}}, color={0,0,127}));
570567
connect(heaterCooler.coolingPower, PCooler) annotation (Line(points={{84,35.4},
@@ -594,14 +591,14 @@ equation
594591
47.24},{9.94,52},{26,52},{26,89},{37,89}}, color={0,0,127}));
595592

596593
connect(ventCont.y, addInfVen.u1) annotation (Line(
597-
points={{-49,-24},{-41.2,-24},{-41.2,-24.4}},
594+
points={{-49,-24},{-41,-24}},
598595
color={0,0,127},
599596
smooth=Smooth.None));
600597
connect(intGains[1], ventCont.relOccupation) annotation (Line(points={{80,
601598
-113.333},{80,-92},{46,-92},{46,-36},{-68,-36},{-68,-30}}, color=
602599
{0,0,127}));
603600
connect(ventRate, addInfVen.u2) annotation (Line(points={{-108,-64},{-76,-64},
604-
{-76,-34},{-44,-34},{-44,-31.6},{-41.2,-31.6}},
601+
{-76,-34},{-44,-34},{-44,-30},{-41,-30}},
605602
color={0,0,127}));
606603
connect(ventRate, mixedTemp.flowRate_flow1) annotation (Line(points={{-108,-64},
607604
{-76,-64},{-76,3.2},{-55.84,3.2}}, color={0,0,127}));
@@ -611,13 +608,10 @@ equation
611608
0},{-2,0},{-2,-14},{-72,-14},{-72,-18},{-68,-18}}, color={0,0,
612609
127}));
613610
connect(preTemVen.port, airExc.port_a)
614-
annotation (Line(points={{-32,0},{-26,0},{-26,-4},{-22,-4}},
611+
annotation (Line(points={{-32,1},{-26,1},{-26,-4},{-22,-4}},
615612
color={191,0,0}));
616-
connect(mixedTemp.mixedTemperatureOut, preTemVen.T)
617-
annotation (Line(points={{-48,2},{-44,2},{-44,0},{-40.8,0}},
618-
color={0,0,127}));
619-
connect(addInfVen.y, airExc.ventRate) annotation (Line(points={{-27.4,-28},{
620-
-24,-28},{-24,-10},{-21.2,-10},{-21.2,-9.12}}, color={0,0,
613+
connect(addInfVen.y, airExc.ventRate) annotation (Line(points={{-29.5,-27},{
614+
-24,-27},{-24,-10},{-21.2,-10},{-21.2,-9.12}}, color={0,0,
621615
127}));
622616
connect(airExc.port_b, ROM.intGainsConv) annotation (Line(points={{-6,-4},{44,
623617
-4},{44,-2},{92,-2},{92,78},{86,78}},color={191,0,0}));
@@ -650,9 +644,9 @@ equation
650644
end if;
651645

652646

653-
if not use_MechnicalAirExchange then
647+
if not use_MechanicalAirExchange then
654648
connect(weaBus.TDryBul, preTemVen.T) annotation (Line(
655-
points={{-100,34},{-86,34},{-86,10},{-42,10},{-42,0},{-40.8,0}},
649+
points={{-100,34},{-86,34},{-86,10},{-42,10},{-42,1},{-38.6,1}},
656650
color={255,204,51},
657651
thickness=0.5,
658652
pattern=LinePattern.Dash), Text(
@@ -673,8 +667,11 @@ if not use_MechnicalAirExchange then
673667
color={0,0,127},
674668
pattern=LinePattern.Dash));
675669
if use_moisture_balance then
670+
connect(x_pTphi.X[1], airExcMoi.HumIn) annotation (Line(
671+
points={{-63.7,-9},{-62,-9},{-62,-10},{-34,-10},{-34,-8},{-21.2,-8}},
672+
color={0,0,127},
673+
pattern=LinePattern.Dash));
676674
end if;
677-
678675
elseif not use_NaturalAirExchange then
679676
connect(ventRate, cO2Balance.airExc) annotation (Line(
680677
points={{-108,-64},{-74,-64},{-74,-34},{12,-34},{12,-64.9},{20,-64.9}},
@@ -688,16 +685,31 @@ if not use_MechnicalAirExchange then
688685
points={{-108,-64},{-74,-64},{-74,-34},{-24,-34},{-24,-9.12},{-21.2,-9.12}},
689686
color={0,0,127},
690687
pattern=LinePattern.Dash));
688+
connect(ventTemp, preTemVen.T) annotation (Line(
689+
points={{-108,-40},{-78,-40},{-78,6},{-44,6},{-44,1},{-38.6,1}},
690+
color={0,0,127},
691+
pattern=LinePattern.Dash));
692+
if use_moisture_balance then
693+
connect(ventHum, airExcMoi.HumIn) annotation (Line(
694+
points={{-108,-88},{-74,-88},{-74,-2},{-46,-2},{-46,-4},{-30,-4},{-30,-8},
695+
{-21.2,-8}},
696+
color={0,0,127},
697+
pattern=LinePattern.Dash));
698+
end if;
691699
else
692-
connect(addInfVen.y, cO2Balance.airExc) annotation (Line(points={{-27.4,-28},
693-
{-24,-28},{-24,-34},{12,-34},{12,-64.9},{20,-64.9}},
700+
connect(addInfVen.y, cO2Balance.airExc) annotation (Line(points={{-29.5,
701+
-27},{-24,-27},{-24,-34},{12,-34},{12,-64.9},{20,-64.9}},
694702
color={0,0,127}));
695-
connect(addInfVen.y, airExc.ventRate) annotation (Line(points={{-27.4,-28},
696-
{-24,-28},{-24,-9.12},{-21.2,-9.12}}, color={0,0,127}));
697-
connect(addInfVen.y, airExcMoi.ventRate) annotation (Line(points={{-27.4,-28},
698-
{-24,-28},{-24,-9.12},{-21.2,-9.12}}, color={0,0,127}));
703+
connect(addInfVen.y, airExc.ventRate) annotation (Line(points={{-29.5,-27},
704+
{-24,-27},{-24,-9.12},{-21.2,-9.12}}, color={0,0,127}));
705+
connect(addInfVen.y, airExcMoi.ventRate) annotation (Line(points={{-29.5,
706+
-27},{-24,-27},{-24,-9.12},{-21.2,-9.12}},
707+
color={0,0,127}));
708+
connect(mixedTemp.mixedTemperatureOut, preTemVen.T) annotation (Line(points={{-48,2},
709+
{-44,2},{-44,1},{-38.6,1}}, color={0,0,127}));
699710
end if;
700711

712+
701713
connect(moistureGains.QLat_flow, SumQLat1_flow.u[2]) annotation (Line(points={{-59.5,
702714
-73},{-52,-73},{-52,-74},{-46,-74},{-46,-64.1},{-40,-64.1}}, color=
703715
{0,0,127}));
@@ -711,8 +723,8 @@ end if;
711723
connect(humVolAirROM.y, X_w) annotation (Line(points={{-59.5,-50},{4,-50},{4,
712724
-6},{96,-6},{96,-70},{110,-70}},
713725
color={0,0,127}));
714-
connect(addInfVen.y, cO2Balance.airExc) annotation (Line(points={{-27.4,-28},{
715-
-24,-28},{-24,-40},{12,-40},{12,-64.9},{20,-64.9}},
726+
connect(addInfVen.y, cO2Balance.airExc) annotation (Line(points={{-29.5,-27},
727+
{-24,-27},{-24,-40},{12,-40},{12,-64.9},{20,-64.9}},
716728
color={0,0,127}));
717729
connect(cO2Balance.uRel, intGains[1]) annotation (Line(points={{20,-61.4},{20,
718730
-50},{46,-50},{46,-113.333},{80,-113.333}}, color={0,0,127}));
@@ -726,12 +738,10 @@ end if;
726738
{10.9,-67}}, color={0,0,127}));
727739
connect(ROM.C_flow[1], cO2Balance.mCO2_flow) annotation (Line(points={{37,84},
728740
{34,84},{34,-6},{50,-6},{50,-62.8},{34.7,-62.8}}, color={0,0,127}));
729-
730-
connect(airExcMoi.port_a, preTemVen.port)
731-
annotation (Line(points={{-22,-4},{-26,-4},{-26,0},{-32,0}},
732-
color={191,0,0}));
741+
connect(airExcMoi.port_a, preTemVen.port) annotation (Line(points={{-22,-4},
742+
{-26,-4},{-26,1},{-32,1}}, color={191,0,0}));
733743
connect(airExcMoi.ventRate, addInfVen.y) annotation (Line(points={{-21.2,
734-
-9.12},{-24,-9.12},{-24,-28},{-27.4,-28}}, color={0,0,127}));
744+
-9.12},{-24,-9.12},{-24,-27},{-29.5,-27}}, color={0,0,127}));
735745
connect(airExcMoi.port_b, ROM.intGainsConv) annotation (Line(points={{-6,-4},
736746
{58,-4},{58,78},{86,78}}, color={191,0,0}));
737747
connect(airExcMoi.QLat_flow, SumQLat2_flow.u[3]) annotation (Line(points={{
@@ -774,12 +784,11 @@ end if;
774784
index=-1,
775785
extent={{-6,3},{-6,3}},
776786
horizontalAlignment=TextAlignment.Right));
777-
connect(x_pTphi.X[1], airExcMoi.HumIn) annotation (Line(
778-
points={{-63.7,-9},{-62,-9},{-62,-10},{-34,-10},{-34,-8},{-21.2,-8}},
779-
color={0,0,127},
780-
pattern=LinePattern.Dash));
781787
connect(mixedHumidity.mixedHumidityOut, airExcMoi.HumIn) annotation (Line(
782788
points={{-48,-6},{-34,-6},{-34,-8},{-21.2,-8}}, color={0,0,127}));
789+
connect(TSetHeat, heaterCooler.setPointHeat) annotation (Line(points={{-108,-16},
790+
{-86,-16},{-86,6},{74,6},{74,18},{75.42,18},{75.42,28.8}}, color={0,0,
791+
127}));
783792
annotation (Documentation(revisions="<html><ul>
784793
<li>November 20, 2020, by Katharina Breuer:<br/>
785794
Combine thermal zone models

0 commit comments

Comments
 (0)