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

Issue1297 fluid ports hom #1334

Merged
merged 9 commits into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion AixLib/ThermalZones/HighOrder/Examples/OFDHeatLoad.mo
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ model OFDHeatLoad "Test environment to determine OFD's nominal heat load"
choice=4 "WSchV_1984",
radioButtons=true));

replaceable package MediumAir = AixLib.Media.Air "Medium within the room";


Modelica.Blocks.Sources.Constant constRooms[nHeatedRooms](k={293.15,293.15,288.15,293.15,293.15,293.15,293.15,288.15,297.15,293.15}) "1: LivingRoom_GF, 2: Hobby_GF, 3: Corridor_GF, 4: WC_Storage_GF, 5: Kitchen_GF, 6: Bedroom_UF, 7: Child1_UF, 8: Corridor_UF, 9: Bath_UF, 10: Child2_UF, 11: Attic" annotation (Placement(transformation(extent={{-70,-62},{-50,-42}})));
Modelica.Blocks.Sources.Constant constAirEx[nRooms](k={0.5,0.5,0,0.5,0.5,0.5,0.5,0,0.5,0.5,0}) "1: LivingRoom_GF, 2: Hobby_GF, 3: Corridor_GF, 4: WC_Storage_GF, 5: Kitchen_GF, 6: Bedroom_UF, 7: Child1_UF, 8: Corridor_UF, 9: Bath_UF, 10: Child2_UF, 11: Attic" annotation (Placement(transformation(extent={{-70,6},{-50,26}})));
Expand Down Expand Up @@ -56,6 +58,7 @@ model OFDHeatLoad "Test environment to determine OFD's nominal heat load"
Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple,
use_infiltEN12831=true,
n50=if TIR == 1 or TIR == 2 then 3 else if TIR == 3 then 4 else 6,
redeclare package Medium = MediumAir,
UValOutDoors=if TIR == 1 then 1.8 else 2.9,
upperFloor_Building(Corridor(T0_air=288.15), Bath(T0_air=297.15)),
groundFloor_Building(Corridor(T0_air=288.15)))
Expand Down Expand Up @@ -121,7 +124,7 @@ equation
Line(points={{51,70.0833},{48,70.0833},{48,1.2},{43.68,1.2}}, color={255,
128,0}));
connect(varRad.solarRad_out[5], wholeHouseBuildingEnvelope.SolarRadiationPort_RoofN)
annotation (Line(points={{51,70.25},{48,70.25},{48,43.2},{43.68,43.2}},
annotation (Line(points={{51,70.25},{48,70.25},{48,43.2},{43.68,43.2}},
color=
{255,128,0}));
connect(varRad.solarRad_out[6], wholeHouseBuildingEnvelope.SolarRadiationPort_RoofS)
Expand Down
3 changes: 3 additions & 0 deletions AixLib/ThermalZones/HighOrder/Examples/OFD_1Jan.mo
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ model OFD_1Jan "OFD with TMC, TIR and TRY"
choice=4 "WSchV_1984",
radioButtons=true));

replaceable package MediumAir = AixLib.Media.Air "Medium within the room";

parameter AixLib.DataBase.Weather.TRYWeatherBaseDataDefinition weatherDataDay = AixLib.DataBase.Weather.TRYWinterDay();
parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition VentilationProfile = AixLib.DataBase.Profiles.Ventilation2perDayMean05perH();
parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition TSetProfile = AixLib.DataBase.Profiles.SetTemperaturesVentilation2perDay();
Expand Down Expand Up @@ -52,6 +54,7 @@ model OFD_1Jan "OFD with TMC, TIR and TRY"
use_infiltEN12831=true,
n50=if TIR == 1 or TIR == 2 then 3 else if TIR == 3 then 4 else 6,
withDynamicVentilation=true,
redeclare package Medium = MediumAir,
UValOutDoors=if TIR == 1 then 1.8 else 2.9) annotation (Placement(transformation(extent={{-35,-49},{60,46}})));
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature tempOutside
annotation (Placement(transformation(extent={{-4,53},{-16.5,66}})));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ model RoomGFOw2_DayNightMode

parameter AixLib.DataBase.Weather.TRYWeatherBaseDataDefinition weatherDataDay = AixLib.DataBase.Weather.TRYWinterDay();

replaceable package MediumAir = AixLib.Media.Air "Medium within the room";
replaceable package Medium =
AixLib.Media.Water "Medium in the component"
annotation (choices(
Expand All @@ -19,6 +20,7 @@ model RoomGFOw2_DayNightMode

Rooms.OFD.Ow2IwL1IwS1Gr1Uf1 room_GF_2OW(redeclare DataBase.Walls.Collections.OFD.EnEV2009Heavy wallTypes,
energyDynamicsWalls=Modelica.Fluid.Types.Dynamics.SteadyStateInitial,
redeclare package Medium = MediumAir,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
TWalls_start=290.15,
redeclare model WindowModel = Components.WindowsDoors.WindowSimple,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ model GroundFloorBuildingEnvelope
"Type of energy balance: dynamic (3 initialization options) or steady state"
annotation(Evaluate=true, Dialog(tab = "Dynamics", group="Equations"));

replaceable package Medium = Modelica.Media.Interfaces.PartialMedium
"Medium model";

//////////room geometry
parameter Modelica.Units.SI.Length room_width=3.92 "width"
annotation (Dialog(group="Dimensions", descriptionLabel=true));
Expand Down Expand Up @@ -145,7 +148,9 @@ model GroundFloorBuildingEnvelope
final Tset=Tset_Livingroom,
T0_air=T0_air,
final U_door_OD2=UValOutDoors,
final eps_door_OD2=epsOutDoors) annotation (Placement(transformation(extent={{-84,12},{-40,76}})));
final eps_door_OD2=epsOutDoors,
final nPorts=2,
redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-84,12},{-40,76}})));
Rooms.OFD.Ow2IwL1IwS1Gr1Uf1 Hobby(
final denAir=denAir,
final cAir=cAir,
Expand Down Expand Up @@ -189,7 +194,9 @@ model GroundFloorBuildingEnvelope
final Tset=Tset_Hobby,
T0_air=T0_air,
final U_door_OD2=UValOutDoors,
final eps_door_OD2=epsOutDoors) annotation (Placement(transformation(extent={{84,28},{46,76}})));
final eps_door_OD2=epsOutDoors,
final nPorts=2,
redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,28},{46,76}})));
Rooms.OFD.Ow2IwL1IwS1Gr1Uf1 WC_Storage(
final denAir=denAir,
final cAir=cAir,
Expand Down Expand Up @@ -235,7 +242,9 @@ model GroundFloorBuildingEnvelope
final Tset=Tset_WC,
T0_air=T0_air,
final U_door_OD2=UValOutDoors,
final eps_door_OD2=epsOutDoors) annotation (Placement(transformation(extent={{82,-36},{44,-84}})));
final eps_door_OD2=epsOutDoors,
final nPorts=2,
redeclare package Medium = Medium) annotation (Placement(transformation(extent={{82,-36},{44,-84}})));
Rooms.OFD.Ow2IwL2IwS1Gr1Uf1 Kitchen(
final denAir=denAir,
final cAir=cAir,
Expand Down Expand Up @@ -281,7 +290,9 @@ model GroundFloorBuildingEnvelope
final Tset=Tset_Kitchen,
T0_air=T0_air,
final U_door_OD2=UValOutDoors,
final eps_door_OD2=epsOutDoors) annotation (Placement(transformation(extent={{-84,-20},{-44,-84}})));
final eps_door_OD2=epsOutDoors,
final nPorts=2,
redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-84,-20},{-44,-84}})));
Rooms.OFD.Ow1IwL2IwS1Gr1Uf1 Corridor(
final denAir=denAir,
final cAir=cAir,
Expand Down Expand Up @@ -323,7 +334,9 @@ model GroundFloorBuildingEnvelope
final ratioSunblind=ratioSunblind,
final solIrrThreshold=solIrrThreshold,
final TOutAirLimit=TOutAirLimit,
T0_air=T0_air) annotation (Placement(transformation(extent={{82,-28},{42,10}})));
T0_air=T0_air,
final nPorts=2,
redeclare package Medium = Medium) annotation (Placement(transformation(extent={{82,-28},{42,10}})));
Utilities.Interfaces.SolarRad_in North annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
Expand All @@ -339,10 +352,11 @@ model GroundFloorBuildingEnvelope
Utilities.Interfaces.SolarRad_in West annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
origin={110,-16})));
origin={110,-4})));
Modelica.Blocks.Interfaces.RealInput WindSpeedPort if (calcMethodOut == 1 or calcMethodOut == 2)
annotation (Placement(transformation(extent={{-130,12},{-100,42}})));
Modelica.Blocks.Interfaces.RealInput AirExchangePort[5] "1: LivingRoom_GF, 2: Hobby_GF, 3: Corridor, 4: WC_Storage_GF, 5: Kitchen_GF"
Modelica.Blocks.Interfaces.RealInput AirExchangePort[5]
"1: LivingRoom_GF, 2: Hobby_GF, 3: Corridor, 4: WC_Storage_GF, 5: Kitchen_GF"
annotation (Placement(transformation(extent={{-130,-18},{-100,12}})));

Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a thermCeiling_Livingroom
Expand All @@ -360,15 +374,29 @@ model GroundFloorBuildingEnvelope
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a groundTemp[5]
"HeatPort to force a ground temperature for the ground level's floor."
annotation (Placement(transformation(extent={{-10,-110},{10,-90}})));
Utilities.Interfaces.Adaptors.ConvRadToCombPort heatStarToCombHeaters[5] annotation (Placement(transformation(extent={{10,-8},{-10,8}},
Utilities.Interfaces.Adaptors.ConvRadToCombPort heatStarToCombHeaters[5]
annotation (Placement(transformation(
extent={{10,-8},{-10,8}},
rotation=90,
origin={0,-28})));
Utilities.Interfaces.ConvRadComb portConvRadRooms[5] "1: LivingRoom_GF, 2: Hobby_GF, 3: Corridor, 4: WC_Storage_GF, 5: Kitchen_GF" annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
Utilities.Interfaces.ConvRadComb portConvRadRooms[5]
"1: LivingRoom_GF, 2: Hobby_GF, 3: Corridor, 4: WC_Storage_GF, 5: Kitchen_GF"
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
Modelica.Fluid.Interfaces.FluidPort_a portVent_in[5](redeclare final package
Medium = Medium) "Inlet for ventilation" annotation (Placement(
transformation(extent={{94,-78},{114,-58}}), iconTransformation(extent={
{94,-70},{108,-56}})));
Modelica.Fluid.Interfaces.FluidPort_b portVent_out[5](redeclare final package
Medium = Medium) "Outlet of Ventilation" annotation (Placement(
transformation(extent={{94,-94},{114,-74}}), iconTransformation(extent={
{94,-94},{108,-80}})));
equation
connect(Livingroom.SolarRadiationPort_OW2, West) annotation (Line(points={{-50.89,75.68},{-50.89,86},{90,86},{90,-16},{110,-16}},
connect(Livingroom.SolarRadiationPort_OW2, West) annotation (Line(points={{-50.89,
75.68},{-50.89,82},{-12,82},{-12,78},{42,78},{42,84},{84,84},{84,86},{
90,86},{90,-4},{110,-4}}, color={255,128,0}));
connect(Hobby.SolarRadiationPort_OW2, West) annotation (Line(points={{55.405,75.76},
{54,75.76},{54,84},{84,84},{84,86},{90,86},{90,-4},{110,-4}},
color={255,128,0}));
connect(Hobby.SolarRadiationPort_OW2, West) annotation (Line(points={{55.405,
75.76},{55.405,86},{90,86},{90,-16},{110,-16}}, color={255,128,0}));
connect(Hobby.SolarRadiationPort_OW1, North) annotation (Line(points={{83.905,
59.2},{90,59.2},{90,88},{110,88}}, color={255,128,0}));
connect(Corridor.SolarRadiationPort_OW1, North) annotation (Line(points={{
Expand Down Expand Up @@ -441,10 +469,10 @@ equation
connect(Corridor.thermRoom, thermCorridor) annotation (Line(points={{64.8,-9},{64.8,-32},{90,-32},{90,100},{110,100},{110,110}},
color={191,0,0}));
connect(Livingroom.AirExchangePort, AirExchangePort[1]) annotation (Line(
points={{-86.2,66.24},{-86.2,66},{-92,66},{-92,-9},{-115,-9}},
points={{-86.2,66.24},{-86.2,66},{-92,66},{-92,-15},{-115,-15}},
color={0,0,127}));
connect(Hobby.AirExchangePort, AirExchangePort[2]) annotation (Line(points={{85.9,
68.68},{85.9,78},{86,78},{86,88},{-92,88},{-92,-6},{-115,-6}},color={
68.68},{85.9,78},{86,78},{86,88},{-92,88},{-92,-9},{-115,-9}},color={
0,0,127}));
connect(Kitchen.SolarRadiationPort_OW1, South) annotation (Line(points={{-83.9,
-61.6},{-90,-61.6},{-90,-92},{90,-92},{90,26},{110,26}}, color={255,
Expand All @@ -453,25 +481,25 @@ equation
Line(points={{44,-10.9},{36,-10.9},{36,-92},{-34,-92},{-34,-48.8},{-46,-48.8}},
color={191,0,0}));

connect(Livingroom.ground, groundTemp[1]) annotation (Line(points={{-63.32,13.92},
{-63.32,-8},{-32,-8},{-32,-88},{0,-88},{0,-104}},
connect(Livingroom.ground, groundTemp[1]) annotation (Line(points={{-63.32,
13.92},{-63.32,-8},{-32,-8},{-32,-88},{0,-88},{0,-108}},
color={191,0,0}));
connect(Hobby.ground, groundTemp[2]) annotation (Line(points={{66.14,29.44},{66.14,
26},{34,26},{34,-88},{0,-88},{0,-102}},
connect(Hobby.ground, groundTemp[2]) annotation (Line(points={{66.14,29.44},{
66.14,26},{34,26},{34,-88},{0,-88},{0,-104}},
color={191,0,0}));
connect(Corridor.ground, groundTemp[3]) annotation (Line(points={{63.2,-26.86},{63.2,-34},{34,-34},{34,-88},{0,-88},{0,-100}},
color={191,0,0}));
connect(WC_Storage.ground, groundTemp[4]) annotation (Line(points={{64.14,-37.44},
{64.14,-34},{34,-34},{34,-88},{0,-88},{0,-98}},
connect(WC_Storage.ground, groundTemp[4]) annotation (Line(points={{64.14,
-37.44},{64.14,-34},{34,-34},{34,-88},{0,-88},{0,-96}},
color={191,0,0}));
connect(Kitchen.ground, groundTemp[5]) annotation (Line(points={{-65.2,-21.92},
{-65.2,-14},{-32,-14},{-32,-88},{0,-88},{0,-96}},
{-65.2,-14},{-32,-14},{-32,-88},{0,-88},{0,-92}},
color={191,0,0}));
connect(Corridor.AirExchangePort, AirExchangePort[3]) annotation (Line(points={{84,4.205},{86,4.205},{86,4},{88,4},{88,-90},{-92,-90},{-92,-3},{-115,-3}}, color={0,0,127}));
connect(WC_Storage.AirExchangePort, AirExchangePort[4]) annotation (Line(points={{83.9,
-76.68},{88,-76.68},{88,-90},{-92,-90},{-92,0},{-115,0}}, color={0,0,127}));
-76.68},{88,-76.68},{88,-90},{-92,-90},{-92,3},{-115,3}}, color={0,0,127}));
connect(Kitchen.AirExchangePort, AirExchangePort[5]) annotation (Line(points={{-86,
-74.24},{-92,-74.24},{-92,3},{-115,3}}, color={0,0,127}));
-74.24},{-92,-74.24},{-92,9},{-115,9}}, color={0,0,127}));
connect(heatStarToCombHeaters.portConvRadComb, portConvRadRooms) annotation (Line(points={{0,-18},{0,0}}, color={191,0,0}));
connect(Livingroom.starRoom, heatStarToCombHeaters[1].portRad) annotation (Line(points={{-58.48,44},{-58,44},{-58,30},{-16,30},{-16,-38},{-5,-38}}, color={0,0,0}));
connect(Livingroom.thermRoom, heatStarToCombHeaters[1].portConv) annotation (Line(points={{-65.08,44},{-66,44},{-66,26},{-20,26},{-20,-44},{5,-44},{5,-38}}, color={191,0,0}));
Expand All @@ -483,6 +511,38 @@ equation
connect(WC_Storage.thermRoom, heatStarToCombHeaters[4].portConv) annotation (Line(points={{65.66,-60},{66,-60},{66,-44},{5,-44},{5,-38}}, color={191,0,0}));
connect(Kitchen.starRoom, heatStarToCombHeaters[5].portRad) annotation (Line(points={{-60.8,-52},{-60,-52},{-60,-38},{-5,-38}}, color={0,0,0}));
connect(Kitchen.thermRoom, heatStarToCombHeaters[5].portConv) annotation (Line(points={{-66.8,-52},{-66,-52},{-66,-44},{5,-44},{5,-38}}, color={191,0,0}));
connect(Livingroom.ports[1], portVent_in[1]) annotation (Line(points={{-65.355,
11.52},{-58,11.52},{-58,-8},{-20,-8},{-20,-92},{94,-92},{94,-76},{104,
-76}},
color={0,127,255}));
connect(Livingroom.ports[2], portVent_out[1]) annotation (Line(points={{-58.645,
11.52},{-58,11.52},{-58,-8},{-20,-8},{-20,-92},{104,-92}},
color={0,127,255}));
connect(Hobby.ports[1], portVent_in[2]) annotation (Line(points={{67.8975,27.64},
{40,27.64},{40,28},{20,28},{20,-92},{94,-92},{94,-72},{104,-72}},
color={0,127,255}));
connect(Hobby.ports[2], portVent_out[2]) annotation (Line(points={{62.1025,27.64},
{20,27.64},{20,-92},{94,-92},{94,-84},{104,-84},{104,-88}},
color={0,127,255}));
connect(Corridor.ports[1], portVent_in[3]) annotation (Line(points={{65.05,-28.285},
{40,-28.285},{40,-28},{20,-28},{20,-92},{94,-92},{94,-68},{104,-68}},
color={0,127,255}));
connect(Corridor.ports[2], portVent_out[3]) annotation (Line(points={{58.95,-28.285},
{58.95,-32},{20,-32},{20,-92},{94,-92},{94,-84},{104,-84}},
color={0,127,255}));
connect(WC_Storage.ports[1], portVent_in[4]) annotation (Line(points={{65.8975,
-35.64},{62,-35.64},{62,-32},{20,-32},{20,-92},{94,-92},{94,-64},{104,
-64}},
color={0,127,255}));
connect(WC_Storage.ports[2], portVent_out[4]) annotation (Line(points={{60.1025,
-35.64},{60.1025,-32},{20,-32},{20,-92},{94,-92},{94,-80},{104,-80}},
color={0,127,255}));
connect(Kitchen.ports[1], portVent_in[5]) annotation (Line(points={{-67.05,-19.52},
{-58,-19.52},{-58,-8},{-20,-8},{-20,-92},{94,-92},{94,-60},{104,-60}},
color={0,127,255}));
connect(Kitchen.ports[2], portVent_out[5]) annotation (Line(points={{-60.95,-19.52},
{-58,-19.52},{-58,-8},{-20,-8},{-20,-92},{94,-92},{94,-76},{104,-76}},
color={0,127,255}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Bitmap(extent={{-100,-100},{100,100}}, fileName=
Expand Down
Loading