Skip to content

Commit

Permalink
Updates NamingConvention for MoistAirZones
Browse files Browse the repository at this point in the history
Fixes Bug in HumanInternalGainModels -> set use_A_in = true

For #707 ,#770
  • Loading branch information
martinkremer committed Nov 13, 2019
1 parent 252c296 commit af3e7e0
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ model ComparisonThermalZoneMoistAndDryAir

AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZoneMoistAir thermalZoneMoistAir(
ROM(extWallRC(thermCapExt(each der_T(fixed=true))), intWallRC(thermCapInt(
each der_T(fixed=true)))),
each der_T(fixed=true)))),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
redeclare package Medium = Media.Air,
internalGainsMode=3,
Expand All @@ -21,13 +21,6 @@ model ComparisonThermalZoneMoistAndDryAir
filNam=Modelica.Utilities.Files.loadResource("modelica://AixLib/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"))
"Weather data reader"
annotation (Placement(transformation(extent={{-98,-18},{-78,2}})));
AixLib.BoundaryConditions.WeatherData.Bus weaBus
"Weather data bus"
annotation (Placement(transformation(extent={{-78,-32},{-44,0}}),
iconTransformation(extent={{-70,-12},{-50,8}})));
Modelica.Blocks.Sources.Constant const(k=0.2)
"Infiltration rate"
annotation (Placement(transformation(extent={{-92,-52},{-72,-32}})));
Modelica.Blocks.Sources.CombiTimeTable internalGains(
extrapolation = Modelica.Blocks.Types.Extrapolation.Periodic,
tableName = "UserProfiles",
Expand Down Expand Up @@ -144,14 +137,12 @@ model ComparisonThermalZoneMoistAndDryAir
T=283.15,
nPorts=1)
annotation (Placement(transformation(extent={{-84,-92},{-64,-72}})));
Fluid.Sources.FixedBoundary sinAir(redeclare package Medium = Media.Air,
Fluid.Sources.Boundary_pT sinAir(redeclare package Medium = Media.Air,
nPorts=1)
annotation (Placement(transformation(extent={{-12,-98},{-32,-78}})));
Utilities.Psychrometrics.X_pTphi x_pTphi
annotation (Placement(transformation(extent={{-46,-38},{-26,-18}})));
AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZone thermalZone(
ROM(extWallRC(thermCapExt(each der_T(fixed=true))), intWallRC(thermCapInt(
each der_T(fixed=true)))),
each der_T(fixed=true)))),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
redeclare package Medium = Media.Air,
internalGainsMode=1,
Expand All @@ -166,9 +157,6 @@ model ComparisonThermalZoneMoistAndDryAir
"Weather data reader"
annotation (Placement(transformation(extent={{-100,78},{-80,98}})));

Modelica.Blocks.Sources.Constant const1(k=0.2)
"Infiltration rate"
annotation (Placement(transformation(extent={{-94,44},{-74,64}})));
Modelica.Blocks.Sources.CombiTimeTable internalGains1(
extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic,
tableName="UserProfiles",
Expand Down Expand Up @@ -283,33 +271,14 @@ model ComparisonThermalZoneMoistAndDryAir
T=283.15,
nPorts=1)
annotation (Placement(transformation(extent={{-86,4},{-66,24}})));
Fluid.Sources.FixedBoundary sinAir1(redeclare package Medium = Media.Air,
Fluid.Sources.Boundary_pT sinAir1(redeclare package Medium = Media.Air,
nPorts=1)
annotation (Placement(transformation(extent={{-14,-2},{-34,18}})));
BoundaryConditions.WeatherData.Bus weaBus1
"Weather data bus"
annotation (Placement(transformation(extent={{-80,64},{-46,96}}),
iconTransformation(extent={{-70,-12},{-50,8}})));
equation
connect(weaDat.weaBus, thermalZoneMoistAir.weaBus) annotation (Line(
points={{-78,-8},{-34,-8},{-34,-12},{-10,-12}},
color={255,204,51},
thickness=0.5));
connect(weaDat.weaBus, weaBus) annotation (Line(
points={{-78,-8},{-61,-8},{-61,-16}},
color={255,204,51},
thickness=0.5), Text(
string="%second",
index=1,
extent={{6,3},{6,3}}));
connect(thermalZoneMoistAir.ventTemp, weaBus.TDryBul) annotation (Line(points=
{{-11.3,-15.9},{-35.65,-15.9},{-35.65,-16},{-61,-16}}, color={0,0,127}),
Text(
string="%second",
index=1,
extent={{6,3},{6,3}}));
connect(const.y, thermalZoneMoistAir.ventRate)
annotation (Line(points={{-71,-42},{-7,-42},{-7,-20.4}}, color={0,0,127}));
connect(internalGains.y, thermalZoneMoistAir.intGains)
annotation (Line(points={{0.7,-64},{8,-64},{8,-20.4}}, color={0,0,127}));
connect(prescribedHeatFlow.port, thermalZoneMoistAir.intGainsRad)
Expand All @@ -332,38 +301,10 @@ equation
connect(thermalZoneMoistAir.ports[2], sinAir.ports[1]) annotation (Line(
points={{2.35,-19.2},{2.35,-52},{-38,-52},{-38,-88},{-32,-88}}, color={
0,127,255}));
connect(weaBus.pAtm, x_pTphi.p_in) annotation (Line(
points={{-61,-16},{-62,-16},{-62,-22},{-48,-22}},
color={255,204,51},
thickness=0.5));
connect(weaBus.TDryBul, x_pTphi.T) annotation (Line(
points={{-61,-16},{-62,-16},{-62,-28},{-48,-28}},
color={255,204,51},
thickness=0.5));
connect(weaBus.relHum, x_pTphi.phi) annotation (Line(
points={{-61,-16},{-62,-16},{-62,-34},{-48,-34}},
color={255,204,51},
thickness=0.5));
connect(x_pTphi.X[1], thermalZoneMoistAir.ventHum) annotation (Line(points={{
-25,-28},{-18,-28},{-18,-18.7},{-11.3,-18.7}}, color={0,0,127}));
connect(weaDat1.weaBus, thermalZone.weaBus) annotation (Line(
points={{-80,88},{-36,88},{-36,84},{-12,84}},
color={255,204,51},
thickness=0.5));
connect(weaDat1.weaBus, weaBus1) annotation (Line(
points={{-80,88},{-63,88},{-63,80}},
color={255,204,51},
thickness=0.5), Text(
string="%second",
index=1,
extent={{6,3},{6,3}}));
connect(thermalZone.ventTemp, weaBus1.TDryBul) annotation (Line(points={{-13.3,
80.1},{-37.65,80.1},{-37.65,80},{-63,80}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}}));
connect(const1.y, thermalZone.ventRate)
annotation (Line(points={{-73,54},{-9,54},{-9,75.6}}, color={0,0,127}));
connect(internalGains1.y, thermalZone.intGains)
annotation (Line(points={{-1.3,32},{6,32},{6,75.6}}, color={0,0,127}));
connect(prescribedHeatFlow2.port, thermalZone.intGainsRad)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
within AixLib.ThermalZones.ReducedOrder.Examples;
model ThermalZoneMoistAirEquipped
model ThermalZoneMoistAirExchange
"Illustrates the use of ThermalZoneMoistAirEquipped"
extends Modelica.Icons.Example;

AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZoneMoistAirEquipped thermalZone(
AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZoneMoistAirExchange thermalZone(
ROM(extWallRC(thermCapExt(each der_T(fixed=true))), intWallRC(thermCapInt(
each der_T(fixed=true)))),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
Expand Down Expand Up @@ -205,4 +205,4 @@ equation
</li>
</ul>
</html>"));
end ThermalZoneMoistAirEquipped;
end ThermalZoneMoistAirExchange;
2 changes: 1 addition & 1 deletion AixLib/ThermalZones/ReducedOrder/Examples/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SimpleRoomTwoElements
ThermalZone
ThermalZoneEquipped
ThermalZoneMoistAir
ThermalZoneMoistAirEquipped
ThermalZoneMoistAirExchange
MultizoneMoistAir
MultizoneMoistAirEquipped
ComparisonThermalZoneMoistAndDryAir
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ partial model PartialMultizone "Partial model for multizone models"
"Model for correction of solar transmission"
annotation(choicesAllMatching=true);
replaceable model thermalZone =
AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZoneEquipped
AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZoneAirExchange
constrainedby
AixLib.ThermalZones.ReducedOrder.ThermalZone.BaseClasses.PartialThermalZone
"Thermal zone model"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
within AixLib.ThermalZones.ReducedOrder.Multizone;
model MultizoneMoistAir "Multizone model with humidity balance"
extends Multizone(redeclare final model thermalZone =
AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZoneMoistAirEquipped);
AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZoneMoistAirExchange);
Modelica.Blocks.Interfaces.RealInput ventHum[numZones] if ASurTot > 0 or
VAir > 0 "Ventilation and infiltration humidity"
annotation (Placement(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ model MultizoneMoistAirEquipped
extends
AixLib.ThermalZones.ReducedOrder.Multizone.BaseClasses.PartialMultizone(
redeclare final model thermalZone =
AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZoneMoistAirEquipped);
AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZoneMoistAirExchange);

parameter Boolean heatAHU
"Status of heating of AHU"
Expand Down Expand Up @@ -344,8 +344,9 @@ equation
Line(points={{44,20.8},{44,12},{28,12},{28,44},{-56,44},{-56,31},{-50.6,
31}},
color={0,0,127}));
connect(zone.X_w, X_w) annotation (Line(points={{82.1,84.67},{94,84.67},{94,94},
{110,94}}, color={0,0,127}));
connect(zone.X_w, X_w) annotation (Line(points={{82.1,72.78},{94,72.78},{94,
94},{110,94}},
color={0,0,127}));
connect(minTemp.y, absToRelHum.TDryBul) annotation (Line(points={{19.5,-28},{-100,
-28},{-100,72},{-42,72},{-42,78.2},{-37,78.2}}, color={0,0,127}));
connect(AirHandlingUnit.T_supplyAirOut, relToAbsHum1.TDryBul) annotation (
Expand All @@ -356,8 +357,8 @@ equation
connect(replicatorHumidityVentilation.y, zone.ventHum) annotation (Line(
points={{65,42.5},{65,44},{30,44},{30,55.765},{35.27,55.765}}, color={0,
0,127}));
connect(zone.X_w, moistSplitter.portIn) annotation (Line(points={{82.1,84.67},
{94,84.67},{94,100},{-76,100},{-76,86},{-68,86}}, color={0,0,127}));
connect(zone.X_w, moistSplitter.portIn) annotation (Line(points={{82.1,72.78},
{94,72.78},{94,100},{-76,100},{-76,86},{-68,86}}, color={0,0,127}));
connect(moistSplitter.portOut[1], absToRelHum.absHum) annotation (Line(points=
{{-48,86},{-44,86},{-44,83.6},{-37,83.6}}, color={0,0,127}));
connect(AirHandlingUnit.phi_supply, relToAbsHum1.relHum) annotation (Line(
Expand Down
9 changes: 6 additions & 3 deletions AixLib/ThermalZones/ReducedOrder/ThermalZone/ThermalZone.mo
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ model ThermalZone
final RoomArea=zoneParam.AZone,
final specificPersons=zoneParam.specificPeople,
final activityDegree=zoneParam.activityDegree,
final specificHeatPerPerson=zoneParam.fixedHeatFlowRatePersons) if
final specificHeatPerPerson=zoneParam.fixedHeatFlowRatePersons,
final RadiationConvertor(use_A_in=true)) if
ATot > 0 and internalGainsMode == 1 annotation (Placement(transformation(extent={{64,-36},{84,-16}})));

Utilities.Sources.InternalGains.Humans.HumanSensibleHeat_TemperatureIndependent humanSenHeaIndependent(
final T0=zoneParam.T_start,
final RatioConvectiveHeat=zoneParam.ratioConvectiveHeatPeople,
final RoomArea=zoneParam.AZone,
final specificPersons=zoneParam.specificPeople,
final specificHeatPerPerson=zoneParam.fixedHeatFlowRatePersons) if
final specificHeatPerPerson=zoneParam.fixedHeatFlowRatePersons,
final RadiationConvertor(use_A_in=true)) if
ATot > 0 and internalGainsMode == 2 annotation (Placement(transformation(extent={{64,-36},{84,-16}})));

Utilities.Sources.InternalGains.Humans.HumanTotalHeat_TemperatureDepdendent humanTotHeaDependent(
Expand All @@ -35,7 +37,8 @@ model ThermalZone
final RoomArea=zoneParam.AZone,
final specificPersons=zoneParam.specificPeople,
final activityDegree=zoneParam.activityDegree,
final specificHeatPerPerson=zoneParam.fixedHeatFlowRatePersons) if
final specificHeatPerPerson=zoneParam.fixedHeatFlowRatePersons,
final RadiationConvertor(use_A_in=true)) if
ATot > 0 and internalGainsMode == 3 annotation (Placement(transformation(extent={{64,-36},{84,-16}})));

replaceable Utilities.Sources.InternalGains.Machines.MachinesAreaSpecific
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ within AixLib.ThermalZones.ReducedOrder.ThermalZone;
model ThermalZoneMoistAir "Thermal zone containing moisture balance"
extends ThermalZone(
ROM(final use_moisture_balance=true));
Modelica.Blocks.Interfaces.RealInput ventHum(
final quantity="MassFraction",
final unit="kg/kg",
min=0) if ATot > 0 or zoneParam.VAir > 0
"Ventilation and infiltration humidity" annotation (Placement(
transformation(extent={{-120,-90},{-80,-50}}), iconTransformation(
extent={{-126,-80},{-100,-54}})));
Modelica.Blocks.Math.MultiSum SumQLat_flow(nu=2) if ATot > 0 or
zoneParam.VAir > 0
annotation (Placement(transformation(extent={{16,-36},{28,-24}})));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
within AixLib.ThermalZones.ReducedOrder.ThermalZone;
model ThermalZoneMoistAirEquipped
model ThermalZoneMoistAirExchange
"Thermal zone model considering moisture balance with ventilation, infiltration and internal gains"
extends ThermalZoneMoistAir(SumQLat_flow(nu=3));

Expand All @@ -21,6 +21,34 @@ model ThermalZoneMoistAirEquipped
ATot > 0 or zoneParam.VAir > 0 "Heat flow due to ventilation"
annotation (Placement(transformation(extent={{-22,-26},{-6,-10}})));

Modelica.Blocks.Interfaces.RealInput ventTemp(
final quantity="ThermodynamicTemperature",
final unit="K",
displayUnit="degC",
min=0) if ATot > 0 or zoneParam.VAir > 0
"Ventilation and infiltration temperature"
annotation (Placement(
transformation(extent={{-120,-60},{-80,-20}}), iconTransformation(
extent={{-126,-52},{-100,-26}})));
Modelica.Blocks.Interfaces.RealInput ventRate(final quantity="VolumeFlowRate",
final unit="1/h") if
ATot > 0 or zoneParam.VAir > 0
"Ventilation and infiltration rate"
annotation (
Placement(transformation(
extent={{-20,-20},{20,20}},
rotation=90,
origin={-40,-100}), iconTransformation(
extent={{-12,-12},{12,12}},
rotation=90,
origin={-70,-84})));
Modelica.Blocks.Interfaces.RealInput ventHum(
final quantity="MassFraction",
final unit="kg/kg",
min=0) if ATot > 0 or zoneParam.VAir > 0
"Ventilation and infiltration humidity" annotation (Placement(
transformation(extent={{-120,-90},{-80,-50}}), iconTransformation(
extent={{-126,-80},{-100,-54}})));
protected
Modelica.Blocks.Math.Add addInfVen if ATot > 0 or zoneParam.VAir > 0
"Combines infiltration and ventilation"
Expand Down Expand Up @@ -121,4 +149,4 @@ equation
textString="Ventilation
Infiltration
")}));
end ThermalZoneMoistAirEquipped;
end ThermalZoneMoistAirExchange;
2 changes: 1 addition & 1 deletion AixLib/ThermalZones/ReducedOrder/ThermalZone/package.order
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ThermalZone
ThermalZoneAirExchange
ThermalZoneMoistAir
ThermalZoneMoistAirEquipped
ThermalZoneMoistAirExchange
BaseClasses

0 comments on commit af3e7e0

Please sign in to comment.