Skip to content

Commit cbb5488

Browse files
committed
replace use_AirExchange by use_NaturalAirExchange and use_MechanicalAirExchange [skip ci] #1122
1 parent fc876bb commit cbb5488

File tree

1 file changed

+76
-17
lines changed

1 file changed

+76
-17
lines changed

AixLib/ThermalZones/ReducedOrder/ThermalZone/ThermalZone.mo

+76-17
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ model ThermalZone "Thermal zone containing moisture balance"
99
annotation(choicesAllMatching=true);
1010
parameter Integer internalGainsMode = 1
1111
"decides which internal gains model for persons is used";
12-
parameter Boolean use_AirExchange = false
13-
"Consider infiltration and ventilation by setting true";
12+
parameter Boolean use_NaturalAirExchange = false
13+
"Consider natural infiltration and ventilation by setting true";
14+
parameter Boolean use_MechanicalAirExchange = false
15+
"Consider mechanical ventilation by setting true";
1416

1517
// Heater/ cooler parameters
1618
parameter Boolean recOrSep=true "Use record or seperate parameters"
@@ -215,16 +217,16 @@ model ThermalZone "Thermal zone containing moisture balance"
215217
final maxOverheatingACH=zoneParam.maxOverheatingACH,
216218
final maxSummerACH=zoneParam.maxSummerACH,
217219
final winterReduction=zoneParam.winterReduction,
218-
final Tmean_start=zoneParam.T_start) if
219-
(ATot > 0 or zoneParam.VAir > 0) and use_AirExchange
220+
final Tmean_start=zoneParam.T_start) if (ATot > 0 or zoneParam.VAir > 0)
221+
and use_NaturalAirExchange
220222
"Calculates natural venitlation and infiltration"
221223
annotation (Placement(transformation(extent={{-68,-34},{-48,-14}})));
222-
Utilities.Psychrometrics.MixedTemperature mixedTemp if
223-
(ATot > 0 or zoneParam.VAir > 0) and use_AirExchange
224+
Utilities.Psychrometrics.MixedTemperature mixedTemp if (ATot > 0 or zoneParam.VAir
225+
> 0) and use_NaturalAirExchange and use_MechanicalAirExchange
224226
"Mixes temperature of infiltration flow and mechanical ventilation flow"
225227
annotation (Placement(transformation(extent={{-56,-2},{-48,6}})));
226228
HighOrder.Components.DryAir.VarAirExchange airExc(final V=zoneParam.VAir) if
227-
(ATot > 0 or zoneParam.VAir > 0) and use_AirExchange and not use_moisture_balance
229+
(ATot > 0 or zoneParam.VAir > 0) and (use_NaturalAirExchange or use_MechanicalAirExchange) and not use_moisture_balance
228230
"Heat flow due to ventilation"
229231
annotation (Placement(transformation(extent={{-22,-12},{-6,4}})));
230232

@@ -278,8 +280,9 @@ model ThermalZone "Thermal zone containing moisture balance"
278280
"Ventilation and infiltration humidity" annotation (Placement(
279281
transformation(extent={{-128,-108},{-88,-68}}), iconTransformation(
280282
extent={{-106,-82},{-84,-60}})));
281-
HighOrder.Components.MoistAir.VarMoistAirExchange airExcMoi(final V=zoneParam.VAir) if
282-
(ATot > 0 or zoneParam.VAir > 0) and use_AirExchange and use_moisture_balance
283+
HighOrder.Components.MoistAir.VarMoistAirExchange airExcMoi(final V=zoneParam.VAir) if (ATot
284+
> 0 or zoneParam.VAir > 0) and (use_NaturalAirExchange or
285+
use_MechanicalAirExchange) and use_moisture_balance
283286
"Heat flow due to ventilation"
284287
annotation (Placement(transformation(extent={{-22,-12},{-6,4}})));
285288

@@ -361,16 +364,16 @@ protected
361364
annotation (Placement(transformation(extent={{4,31},{12,38}})));
362365

363366
// protected: AirExchange
364-
Modelica.Blocks.Math.Add addInfVen if
365-
(ATot > 0 or zoneParam.VAir > 0) and use_AirExchange
367+
Modelica.Blocks.Math.Add addInfVen if (ATot > 0 or zoneParam.VAir > 0) and
368+
use_NaturalAirExchange and use_MechanicalAirExchange
366369
"Combines infiltration and ventilation"
367370
annotation (Placement(
368371
transformation(
369372
extent={{-6,-6},{6,6}},
370373
rotation=0,
371374
origin={-34,-28})));
372-
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature preTemVen if
373-
(ATot > 0 or zoneParam.VAir > 0) and use_AirExchange
375+
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature preTemVen if (ATot >
376+
0 or zoneParam.VAir > 0) and (use_MechanicalAirExchange or use_AirExchange)
374377
"Prescribed temperature for ventilation"
375378
annotation (Placement(transformation(
376379
extent={{-4,-4},{4,4}},
@@ -392,11 +395,13 @@ public
392395
"Calculates diffuse solar radiation on titled surface for roof"
393396
annotation (Placement(transformation(extent={{-84,61},{-68,77}})));
394397
Utilities.Psychrometrics.MixedHumidity mixedHumidity if (ATot > 0 or
395-
zoneParam.VAir > 0) and use_AirExchange and use_moisture_balance
398+
zoneParam.VAir > 0) and use_NaturalAirExchange and
399+
use_MechanicalAirExchange and use_moisture_balance
396400
"Mixes humidity of infiltration flow and mechanical ventilation flow"
397401
annotation (Placement(transformation(extent={{-56,-10},{-48,-2}})));
398402
Utilities.Psychrometrics.X_pTphi x_pTphi if (ATot > 0 or zoneParam.VAir > 0)
399-
and use_AirExchange and use_moisture_balance
403+
and use_NaturalAirExchange and use_MechanicalAirExchange and
404+
use_moisture_balance
400405
annotation (Placement(transformation(extent={{-70,-12},{-64,-6}})));
401406
equation
402407
connect(intGains[2], machinesSenHea.uRel) annotation (Line(points={{80,-100},{
@@ -643,6 +648,56 @@ equation
643648
connect(noMoisturePerson.y, SumQLat2_flow.u[1]) annotation (Line(points={{-49.6,
644649
-62},{-40,-62},{-40,-59.2}}, color={0,0,127}));
645650
end if;
651+
652+
653+
if not use_MechnicalAirExchange then
654+
connect(weaBus.TDryBul, preTemVen.T) annotation (Line(
655+
points={{-100,34},{-86,34},{-86,10},{-42,10},{-42,0},{-40.8,0}},
656+
color={255,204,51},
657+
thickness=0.5,
658+
pattern=LinePattern.Dash), Text(
659+
string="%first",
660+
index=-1,
661+
extent={{-6,3},{-6,3}},
662+
horizontalAlignment=TextAlignment.Right));
663+
connect(ventCont.y, cO2Balance.airExc) annotation (Line(
664+
points={{-49,-24},{-46,-24},{-46,-34},{12,-34},{12,-64.9},{20,-64.9}},
665+
color={0,0,127},
666+
pattern=LinePattern.Dash));
667+
connect(ventCont.y, airExcMoi.ventRate) annotation (Line(
668+
points={{-49,-24},{-46,-24},{-46,-12},{-28,-12},{-28,-9.12},{-21.2,-9.12}},
669+
color={0,0,127},
670+
pattern=LinePattern.Dash));
671+
connect(ventCont.y, airExc.ventRate) annotation (Line(
672+
points={{-49,-24},{-46,-24},{-46,-12},{-28,-12},{-28,-9.12},{-21.2,-9.12}},
673+
color={0,0,127},
674+
pattern=LinePattern.Dash));
675+
if use_moisture_balance then
676+
end if;
677+
678+
elseif not use_NaturalAirExchange then
679+
connect(ventRate, cO2Balance.airExc) annotation (Line(
680+
points={{-108,-64},{-74,-64},{-74,-34},{12,-34},{12,-64.9},{20,-64.9}},
681+
color={0,0,127},
682+
pattern=LinePattern.Dash));
683+
connect(ventRate, airExc.ventRate) annotation (Line(
684+
points={{-108,-64},{-74,-64},{-74,-34},{-24,-34},{-24,-9.12},{-21.2,-9.12}},
685+
color={0,0,127},
686+
pattern=LinePattern.Dash));
687+
connect(ventRate, airExcMoi.ventRate) annotation (Line(
688+
points={{-108,-64},{-74,-64},{-74,-34},{-24,-34},{-24,-9.12},{-21.2,-9.12}},
689+
color={0,0,127},
690+
pattern=LinePattern.Dash));
691+
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}},
694+
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}));
699+
end if;
700+
646701
connect(moistureGains.QLat_flow, SumQLat1_flow.u[2]) annotation (Line(points={{-59.5,
647702
-73},{-52,-73},{-52,-74},{-46,-74},{-46,-64.1},{-40,-64.1}}, color=
648703
{0,0,127}));
@@ -684,8 +739,6 @@ equation
684739
color={0,0,127}));
685740
connect(humVolAirROM.y, airExcMoi.HumOut) annotation (Line(points={{-59.5,-50},
686741
{-4,-50},{-4,0},{-6,0},{-6,0.16},{-6.8,0.16}}, color={0,0,127}));
687-
connect(mixedHumidity.mixedHumidityOut, airExcMoi.HumIn) annotation (Line(
688-
points={{-48,-6},{-34,-6},{-34,-8},{-21.2,-8}}, color={0,0,127}));
689742
connect(ventHum, mixedHumidity.humidity_flow1) annotation (Line(points={{-108,
690743
-88},{-74,-88},{-74,-2.88},{-55.84,-2.88}}, color={0,0,127}));
691744
connect(ventRate, mixedHumidity.flowRate_flow1) annotation (Line(points={{-108,
@@ -721,6 +774,12 @@ equation
721774
index=-1,
722775
extent={{-6,3},{-6,3}},
723776
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));
781+
connect(mixedHumidity.mixedHumidityOut, airExcMoi.HumIn) annotation (Line(
782+
points={{-48,-6},{-34,-6},{-34,-8},{-21.2,-8}}, color={0,0,127}));
724783
annotation (Documentation(revisions="<html><ul>
725784
<li>November 20, 2020, by Katharina Breuer:<br/>
726785
Combine thermal zone models

0 commit comments

Comments
 (0)